diff --git a/.eslintrc.js b/.eslintrc.js index 53d0b39d0aea44..dc83c0e8c11e90 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -147,32 +147,32 @@ module.exports = { message: '__defineSetter__ is deprecated.', } ], - /* eslint-disable max-len, quotes */ + /* eslint-disable max-len */ // If this list is modified, please copy the change to lib/.eslintrc.yaml 'no-restricted-syntax': [ 'error', { selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']", - message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead." + message: 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.' }, { - selector: `CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]`, + selector: "CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]", message: 'assert.rejects() must be invoked with at least two arguments.', }, { - selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])`, + selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])", message: 'Use an object as second argument of assert.throws()', }, { - selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]`, + selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]", message: 'assert.throws() must be invoked with at least two arguments.', }, { - selector: `CallExpression[callee.name='setTimeout'][arguments.length<2]`, + selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]", message: 'setTimeout() must be invoked with at least two arguments.', }, { - selector: `CallExpression[callee.name='setInterval'][arguments.length<2]`, + selector: "CallExpression[callee.name='setInterval'][arguments.length<2]", message: 'setInterval() must be invoked with at least 2 arguments.', }, { @@ -243,6 +243,9 @@ module.exports = { 'node-core/no-unescaped-regexp-dot': 'error', }, globals: { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, COUNTER_HTTP_CLIENT_REQUEST: false, COUNTER_HTTP_CLIENT_RESPONSE: false, COUNTER_HTTP_SERVER_REQUEST: false, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 18ce90bb9da344..00000000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,88 +0,0 @@ -# Remember: order matters. Subsequent rules will override prior rules. - -*addons* @nodejs/addon-api -*assert* @nodejs/testing -*async_hook* @nodejs/async_hooks @nodejs/diagnostics -*async_wrap* @nodejs/async_hooks -*buffer* @nodejs/buffer -*child_process* @nodejs/child_process -*cluster* @nodejs/cluster -*crypto* @nodejs/crypto -*eslint* @nodejs/linting -*fs* @nodejs/fs -*tls* @nodejs/tls @nodejs/crypto -*dgram* @nodejs/dgram -*domain* @nodejs/domains -*http* @nodejs/http -*http2* @nodejs/http2 -*https* @nodejs/http @nodejs/crypto @nodejs/tls @nodejs/http2 -*inspector* @nodejs/v8-inspector -*net* @nodejs/streams -*node_api* @nodejs/n-api -*repl* @nodejs/repl -*stream* @nodejs/streams -*timer* @nodejs/timers -*trace_events* @nodejs/trace-events -*url* @nodejs/url -*util* @nodejs/util -*vm* @nodejs/vm -*zlib* @nodejs/zlib - -*esm* @nodejs/modules -/lib/internal/modules/esm/ @nodejs/modules -/lib/internal/bootstrap/loaders.js @nodejs/modules - -/src/node.cc @nodejs/process -/src/node_file.* @nodejs/fs -/src/node_stat_watcher.* @nodejs/fs -/lib/internal/bootstrap/ @nodejs/process -/lib/internal/process/ @nodejs/process -/test/ @nodejs/testing - -/deps/node-inspect @nodejs/V8-inspector -/deps/gtest/ @nodejs/testing @nodejs/v8 @nodejs/v8-update -/deps/icu/ @nodejs/intl -/deps/http_parser/ @nodejs/http-parser @nodejs/http -/deps/zlib/ @nodejs/zlib -/deps/uv/ @nodejs/libuv -/deps/npm/ @nodejs/npm -/deps/v8/ @nodejs/v8 @nodejs/v8-update -/deps/zlib @nodejs/zlib -/deps/openssl @nodejs/crypto - -/benchmark/ @nodejs/performance @nodejs/benchmarking - -/doc/ @nodejs/documentation -*.md @nodejs/documentation -*.py @nodejs/python -*.gyp @nodejs/gyp -*.gypi @nodejs/gyp - -Makefile @nodejs/build -vcbuild.bat @nodejs/build -BUILDING.md @nodejs/build -configure @nodejs/build -BSDMakefile @nodejs/build -android-configure @nodejs/build - -*aix* @nodejs/platform-aix -*arm* @nodejs/platform-arm -*freebsd* @nodejs/platform-freebsd -*macos* @nodejs/platform-macos -*ppc* @nodejs/platform-ppc -*smartos* @nodejs/platform-smartos -*s390* @nodejs/platform-s390 -*windows* @nodejs/platform-windows - -/src/node_postmortem_metadata.cc @nodejs/diagnostics @nodejs/post-mortem -/src/*.d @nodejs/diagnostics @nodejs/platform-smartos @nodejs/platform-freebsd @nodejs/platform-macos @nodejs/dtrace-mdb -/src/node.stp @nodejs/diagnostics - -/.github/ @nodejs/tsc -CODE_OF_CONDUCT.md @nodejs/tsc -COLLABORATOR_GUIDE.md @nodejs/tsc -CONTRIBUTING.md @nodejs/tsc -CPP_STYLE_GUIDE.md @nodejs/tsc -GOVERNANCE.md @nodejs/tsc -LICENSE @nodejs/tsc -/README.md @nodejs/tsc diff --git a/.gitignore b/.gitignore index e6b25de69040fb..27e22ef6183f61 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ !.mailmap !.nycrc !.remarkrc +!.travis.yml core vgcore.* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000000..6415497163a151 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: cpp +compiler: + - clang +sudo: false +cache: ccache +matrix: + include: + - os: linux + node_js: "latest" + install: + - NODE=$(which node) make lint-md-build + script: + - NODE=$(which node) make lint-ci + - os: linux + install: + - ./configure + - make -j2 V= + script: + - make -j2 test-ci +before_install: + - export HOMEBREW_NO_AUTO_UPDATE=1 # work around https://github.com/travis-ci/travis-ci/issues/7456 + - if [ $TRAVIS_OS_NAME = osx ]; then brew install ccache; fi + - export PATH="/usr/local/opt/ccache/libexec:$PATH" + - export CXX="ccache clang++ -Qunused-arguments" + - export CC="ccache clang -Qunused-arguments" + - export JOBS=2 diff --git a/BUILDING.md b/BUILDING.md index 3e053050743c10..48c287a319273e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -311,7 +311,7 @@ $ make ### `Intl` (ECMA-402) support: -[Intl](https://github.com/nodejs/node/wiki/Intl) support is +[Intl](https://github.com/nodejs/node/blob/master/doc/api/intl.md) support is enabled by default, with English data only. #### Default: `small-icu` (English only) support @@ -321,9 +321,6 @@ the full `Intl` (ECMA-402) APIs. It does not need to download any dependencies to function. You can add full data at runtime. -*Note:* more docs are on -[the node wiki](https://github.com/nodejs/node/wiki/Intl). - #### Build with full ICU support (all locales supported by ICU): With the `--download=all`, this may download ICU if you don't have an diff --git a/CHANGELOG.md b/CHANGELOG.md index d676fb51d23490..ee02a4985a7500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,8 @@ release. -10.4.1
+10.5.0
+10.4.1
10.4.0
10.3.0
10.2.1
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index f5ffd35f04aa02..238a72547247b6 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -419,25 +419,20 @@ the future." Node.js uses three Deprecation levels: -* *Documentation-Only Deprecation* refers to elements of the Public API that - should be avoided by developers and that might be staged for a runtime - deprecation in a future Node.js major release. An explicit notice indicating - the deprecation status is added to the API documentation but no functional - changes are implemented in the code. By default there will be no deprecation - warnings emitted for such deprecations at runtime. Documentation-only - deprecations may trigger a runtime warning when Node.js is started with the - [`--pending-deprecation`][] flag or the `NODE_PENDING_DEPRECATION=1` - environment variable is set. - -* *Runtime Deprecation* refers to the use of process warnings emitted at - runtime the first time that a deprecated API is used. A command-line - switch can be used to escalate such warnings into runtime errors that will - cause the Node.js process to exit. As with Documentation-Only Deprecation, - the documentation for the API must be updated to clearly indicate the - deprecated status. - -* *End-of-life* refers to APIs that have gone through Runtime Deprecation and - are no longer subject to the semantic versioning rules used by the project. +* *Documentation-Only Deprecation*: A deprecation notice is added to the API + documentation but no functional changes are implemented in the code. By + default, there will be no warnings emitted for such deprecations at + runtime. Documentation-only deprecations may trigger a runtime warning when + Node.js is started with the [`--pending-deprecation`][] flag or the + `NODE_PENDING_DEPRECATION=1` environment variable is set. + +* *Runtime Deprecation*: A warning is emitted at runtime the first time that a + deprecated API is used. The [`--throw-deprecation`][] flag can be used to + escalate such warnings into runtime errors that will cause the Node.js process + to exit. As with Documentation-Only Deprecation, the documentation for the API + must be updated to clearly indicate the deprecated status. + +* *End-of-life*: The API is no longer subject to the semantic versioning rules. Backward-incompatible changes including complete removal of such APIs may occur at any time. @@ -458,21 +453,21 @@ the documentation for the assigned deprecation identifier must remain in the Node.js API documentation. -A _Deprecation cycle_ is one full Node.js major release during which an API -has been in one of the three Deprecation levels. (Note that Documentation-Only -Deprecations may land in a Node.js minor release but must not be upgraded to -a Runtime Deprecation until the next major release.) +A _Deprecation cycle_ is a major release during which an API has been in one of +the three Deprecation levels. Documentation-Only Deprecations may land in a +minor release but must not be upgraded to a Runtime Deprecation until the next +major release. No API can be moved to End-of-life without first having gone through a Runtime Deprecation cycle. However, there is no requirement that deprecated code must progress ultimately to *End-of-Life*. Documentation-only and runtime deprecations may remain indefinitely. -A best effort will be made to communicate pending deprecations and associated -mitigations with the ecosystem as soon as possible (preferably before the pull -request adding the deprecation lands on the master branch). All deprecations -included in a Node.js release should be listed prominently in the "Notable -Changes" section of the release notes. +Communicate pending deprecations and associated mitigations with the ecosystem +as soon as possible (preferably before the pull request adding the deprecation +lands on the master branch). Use the `notable-change` label on all pull requests +that add a new deprecation or move an existing deprecation to a new deprecation +level. ### Involving the TSC @@ -884,6 +879,7 @@ If you cannot find who to cc for a file, `git shortlog -n -s ` may help. [TSC]: https://github.com/nodejs/TSC [_Deprecation_]: https://en.wikipedia.org/wiki/Deprecation [`--pending-deprecation`]: doc/api/cli.md#--pending-deprecation +[`--throw-deprecation`]: doc/api/cli.md#--throw-deprecation [`node-core-utils`]: https://github.com/nodejs/node-core-utils [backporting guide]: doc/guides/backporting-to-release-lines.md [contributing]: ./doc/guides/contributing/pull-requests.md#commit-message-guidelines diff --git a/Makefile b/Makefile index b11168aaa456af..c2edfe59a4595a 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,6 @@ distclean: $(RM) -r deps/icu $(RM) -r deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp $(RM) $(BINARYTAR).* $(TARBALL).* - $(RM) -r deps/v8/testing/gmock .PHONY: check check: test @@ -276,6 +275,7 @@ test-check-deopts: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential benchmark/misc/function_call/build/Release/binding.node: all \ + benchmark/misc/function_call/napi_binding.c \ benchmark/misc/function_call/binding.cc \ benchmark/misc/function_call/binding.gyp $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ @@ -315,25 +315,14 @@ ADDONS_BINDING_SOURCES := \ # Depends on node-gyp package.json so that build-addons is (re)executed when # node-gyp is updated as part of an npm update. test/addons/.buildstamp: config.gypi \ - deps/npm/node_modules/node-gyp/package.json \ + deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ $(ADDONS_BINDING_GYPS) $(ADDONS_BINDING_SOURCES) \ deps/uv/include/*.h deps/v8/include/*.h \ src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \ test/addons/.docbuildstamp -# Cannot use $(wildcard test/addons/*/) here, it's evaluated before -# embedded addons have been generated from the documentation. -# Ignore folders without binding.gyp -# (https://github.com/nodejs/node/issues/14843) - @for dirname in test/addons/*/; do \ - if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \ - continue; fi ; \ - printf "\nBuilding addon $$PWD/$$dirname\n" ; \ - env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \ - --loglevel=$(LOGLEVEL) rebuild \ - --python="$(PYTHON)" \ - --directory="$$PWD/$$dirname" \ - --nodedir="$$PWD" || exit 1 ; \ - done + env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ + npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ + "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" "$$PWD/test/addons" touch $@ .PHONY: build-addons @@ -355,25 +344,15 @@ ADDONS_NAPI_BINDING_SOURCES := \ # Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale. test/addons-napi/.buildstamp: config.gypi \ - deps/npm/node_modules/node-gyp/package.json \ + deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ $(ADDONS_NAPI_BINDING_GYPS) $(ADDONS_NAPI_BINDING_SOURCES) \ deps/uv/include/*.h deps/v8/include/*.h \ src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \ src/node_api.h src/node_api_types.h -# Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before -# embedded addons have been generated from the documentation. -# Ignore folders without binding.gyp -# (https://github.com/nodejs/node/issues/14843) - @for dirname in test/addons-napi/*/; do \ - if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \ - continue; fi ; \ - printf "\nBuilding addon $$PWD/$$dirname\n" ; \ - env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \ - --loglevel=$(LOGLEVEL) rebuild \ - --python="$(PYTHON)" \ - --directory="$$PWD/$$dirname" \ - --nodedir="$$PWD" || exit 1 ; \ - done + env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ + npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ + "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" \ + "$$PWD/test/addons-napi" touch $@ .PHONY: build-addons-napi @@ -560,6 +539,7 @@ test-with-async-hooks: .PHONY: test-v8-all .PHONY: test-v8-benchmarks .PHONY: test-v8-intl +.PHONY: test-v8-updates ifneq ("","$(wildcard deps/v8/tools/run-tests.py)") # Related CI job: node-test-commit-v8-linux test-v8: v8 ## Runs the V8 test suite on deps/v8. @@ -580,7 +560,10 @@ test-v8-benchmarks: v8 benchmarks \ $(TAP_V8_BENCHMARKS) -test-v8-all: test-v8 test-v8-intl test-v8-benchmarks +test-v8-updates: + $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) v8-updates + +test-v8-all: test-v8 test-v8-intl test-v8-benchmarks test-v8-updates # runs all v8 tests else test-v8 test-v8-intl test-v8-benchmarks test-v8-all: @@ -1061,7 +1044,7 @@ lint-md-build: tools/remark-cli/node_modules \ .PHONY: lint-md ifneq ("","$(wildcard tools/remark-cli/node_modules/)") -LINT_MD_DOC_FILES = $(shell ls doc/**/*.md) +LINT_MD_DOC_FILES = $(shell ls doc/*.md doc/**/*.md) run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES) # Lint all changed markdown files under doc/ tools/.docmdlintstamp: $(LINT_MD_DOC_FILES) diff --git a/README.md b/README.md index 85708d2f1e770f..6167a3599f1c28 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,8 @@ For more information about the governance of the Node.js project, see **Daniel Bevenius** <daniel.bevenius@gmail.com> * [DavidCai1993](https://github.com/DavidCai1993) - **David Cai** <davidcai1993@yahoo.com> (he/him) +* [davisjam](https://github.com/davisjam) - +**Jamie Davis** <davisjam@vt.edu> (he/him) * [devsnek](https://github.com/devsnek) - **Gus Caplan** <me@gus.host> (he/him) * [edsadr](https://github.com/edsadr) - @@ -381,8 +383,6 @@ For more information about the governance of the Node.js project, see **Yuta Hiroto** <hello@hiroppy.me> (he/him) * [iarna](https://github.com/iarna) - **Rebecca Turner** <me@re-becca.org> -* [imran-iq](https://github.com/imran-iq) - -**Imran Iqbal** <imran@imraniqbal.org> * [imyller](https://github.com/imyller) - **Ilkka Myller** <ilkka.myller@nodefield.com> * [indutny](https://github.com/indutny) - @@ -433,8 +433,6 @@ For more information about the governance of the Node.js project, see **Matteo Collina** <matteo.collina@gmail.com> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com> (he/him) -* [micnic](https://github.com/micnic) - -**Nicu Micleușanu** <micnic90@gmail.com> (he/him) * [misterdjules](https://github.com/misterdjules) - **Julien Gilli** <jgilli@nodejs.org> * [mmarchini](https://github.com/mmarchini) - @@ -465,12 +463,6 @@ For more information about the governance of the Node.js project, see **Refael Ackermann** <refack@gmail.com> (he/him) * [richardlau](https://github.com/richardlau) - **Richard Lau** <riclau@uk.ibm.com> -* [rmg](https://github.com/rmg) - -**Ryan Graham** <r.m.graham@gmail.com> -* [robertkowalski](https://github.com/robertkowalski) - -**Robert Kowalski** <rok@kowalski.gd> -* [romankl](https://github.com/romankl) - -**Roman Klauke** <romaaan.git@gmail.com> * [ronkorving](https://github.com/ronkorving) - **Ron Korving** <ron@ronkorving.nl> * [RReverser](https://github.com/RReverser) - @@ -540,12 +532,16 @@ For more information about the governance of the Node.js project, see ### Collaborator Emeriti +* [imran-iq](https://github.com/imran-iq) - +**Imran Iqbal** <imran@imraniqbal.org> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me> * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <lxe@lxe.co> * [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <mattloring@google.com> +* [micnic](https://github.com/micnic) - +**Nicu Micleușanu** <micnic90@gmail.com> (he/him) * [mikeal](https://github.com/mikeal) - **Mikeal Rogers** <mikeal.rogers@gmail.com> * [monsanto](https://github.com/monsanto) - @@ -558,6 +554,12 @@ For more information about the governance of the Node.js project, see **Bert Belder** <bertbelder@gmail.com> * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** <alex@kocharin.ru> +* [rmg](https://github.com/rmg) - +**Ryan Graham** <r.m.graham@gmail.com> +* [robertkowalski](https://github.com/robertkowalski) - +**Robert Kowalski** <rok@kowalski.gd> +* [romankl](https://github.com/romankl) - +**Roman Klauke** <romaaan.git@gmail.com> * [tellnes](https://github.com/tellnes) - **Christian Tellnes** <christian@tellnes.no> * [tunniclm](https://github.com/tunniclm) - @@ -576,12 +578,12 @@ Node.js releases are signed with one of the following GPG keys: `B9AE9905FFD7803F25714661B63B535A4C206CA9` * **Gibson Fahnestock** <gibfahn@gmail.com> `77984A986EBC2AA786BC0F66B01FBB92821C587A` -* **Italo A. Casas** <me@italoacasas.com> -`56730D5401028683275BD23C23EFEFE93C4CFFFE` * **James M Snell** <jasnell@keybase.io> `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` * **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E` +* **Michaël Zasso** <targos@protonmail.com> +`8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <myles.borins@gmail.com> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` * **Rod Vagg** <rod@vagg.org> @@ -591,13 +593,13 @@ The full set of trusted release keys can be imported by running: ```shell gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 -gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E -gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 -gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D -gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 -gpg --keyserver pool.sks-keyservers.net --recv-keys 56730D5401028683275BD23C23EFEFE93C4CFFFE gpg --keyserver pool.sks-keyservers.net --recv-keys 77984A986EBC2AA786BC0F66B01FBB92821C587A +gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 +gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E +gpg --keyserver pool.sks-keyservers.net --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 +gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 +gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D ``` See the section above on [Verifying Binaries](#verifying-binaries) for details @@ -609,6 +611,8 @@ Previous releases may also have been signed with one of the following GPG keys: `9554F04D7259F04124DE6B476D5A82AC7E37093B` * **Isaac Z. Schlueter** <i@izs.me> `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6` +* **Italo A. Casas** <me@italoacasas.com> +`56730D5401028683275BD23C23EFEFE93C4CFFFE` * **Julien Gilli** <jgilli@fastmail.fm> `114F43EE0176B71C7BC219DD50A3051F888C628D` * **Timothy J Fontaine** <tjfontaine@gmail.com> diff --git a/benchmark/es/spread-assign.js b/benchmark/es/spread-assign.js index 3246081ff7197a..bbe07e02e15110 100644 --- a/benchmark/es/spread-assign.js +++ b/benchmark/es/spread-assign.js @@ -15,7 +15,7 @@ function main({ n, context, count, rest, method }) { for (let n = 0; n < count; n++) src[`p${n}`] = n; - let obj; // eslint-disable-line + let obj; // eslint-disable-line no-unused-vars let i; switch (method) { diff --git a/benchmark/fixtures/echo.worker.js b/benchmark/fixtures/echo.worker.js new file mode 100644 index 00000000000000..167a28ad23e830 --- /dev/null +++ b/benchmark/fixtures/echo.worker.js @@ -0,0 +1,7 @@ +'use strict'; + +const { parentPort } = require('worker_threads'); + +parentPort.on('message', (msg) => { + parentPort.postMessage(msg); +}); diff --git a/benchmark/fs/bench-stat-promise.js b/benchmark/fs/bench-stat-promise.js index 96c7058fa6218a..99a5da5799b787 100644 --- a/benchmark/fs/bench-stat-promise.js +++ b/benchmark/fs/bench-stat-promise.js @@ -9,12 +9,12 @@ const bench = common.createBenchmark(main, { }); async function run(n, statType) { - const arg = statType === 'fstat' ? - await fsPromises.open(__filename, 'r') : __filename; + const handleMode = statType === 'fstat'; + const arg = handleMode ? await fsPromises.open(__filename, 'r') : __filename; let remaining = n; bench.start(); while (remaining-- > 0) - await fsPromises[statType](arg); + await (handleMode ? arg.stat() : fsPromises[statType](arg)); bench.end(n); if (typeof arg.close === 'function') diff --git a/benchmark/misc/function_call/binding.gyp b/benchmark/misc/function_call/binding.gyp index 3bfb84493f3e87..ac122ed1a07962 100644 --- a/benchmark/misc/function_call/binding.gyp +++ b/benchmark/misc/function_call/binding.gyp @@ -1,5 +1,9 @@ { 'targets': [ + { + 'target_name': 'napi_binding', + 'sources': [ 'napi_binding.c' ] + }, { 'target_name': 'binding', 'sources': [ 'binding.cc' ] diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index cafff3edc122c6..cbc512c9729137 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -19,6 +19,15 @@ try { } const cxx = binding.hello; +let napi_binding; +try { + napi_binding = require('./build/Release/napi_binding'); +} catch (er) { + console.error('misc/function_call/index.js NAPI-Binding failed to load'); + process.exit(0); +} +const napi = napi_binding.hello; + var c = 0; function js() { return c++; @@ -27,12 +36,12 @@ function js() { assert(js() === cxx()); const bench = common.createBenchmark(main, { - type: ['js', 'cxx'], + type: ['js', 'cxx', 'napi'], n: [1e6, 1e7, 5e7] }); function main({ n, type }) { - const fn = type === 'cxx' ? cxx : js; + const fn = type === 'cxx' ? cxx : type === 'napi' ? napi : js; bench.start(); for (var i = 0; i < n; i++) { fn(); diff --git a/benchmark/misc/function_call/napi_binding.c b/benchmark/misc/function_call/napi_binding.c new file mode 100644 index 00000000000000..d97170e0fcd9c5 --- /dev/null +++ b/benchmark/misc/function_call/napi_binding.c @@ -0,0 +1,26 @@ +#include +#include + +static int32_t increment = 0; + +static napi_value Hello(napi_env env, napi_callback_info info) { + napi_value result; + napi_status status = napi_create_int32(env, increment++, &result); + assert(status == napi_ok); + return result; +} + +NAPI_MODULE_INIT() { + napi_value hello; + napi_status status = + napi_create_function(env, + "hello", + NAPI_AUTO_LENGTH, + Hello, + NULL, + &hello); + assert(status == napi_ok); + status = napi_set_named_property(env, exports, "hello", hello); + assert(status == napi_ok); + return exports; +} diff --git a/benchmark/worker/echo.js b/benchmark/worker/echo.js new file mode 100644 index 00000000000000..32c4bddf7d5f77 --- /dev/null +++ b/benchmark/worker/echo.js @@ -0,0 +1,73 @@ +'use strict'; + +const common = require('../common.js'); +const path = require('path'); +const bench = common.createBenchmark(main, { + workers: [1], + payload: ['string', 'object'], + sendsPerBroadcast: [1, 10], + n: [1e5] +}, { flags: ['--experimental-worker'] }); + +const workerPath = path.resolve(__dirname, '..', 'fixtures', 'echo.worker.js'); + +function main(conf) { + const { Worker } = require('worker_threads'); + + const n = +conf.n; + const workers = +conf.workers; + const sends = +conf.sendsPerBroadcast; + const expectedPerBroadcast = sends * workers; + var payload; + var readies = 0; + var broadcasts = 0; + var msgCount = 0; + + switch (conf.payload) { + case 'string': + payload = 'hello world!'; + break; + case 'object': + payload = { action: 'pewpewpew', powerLevel: 9001 }; + break; + default: + throw new Error('Unsupported payload type'); + } + + const workerObjs = []; + + for (var i = 0; i < workers; ++i) { + const worker = new Worker(workerPath); + workerObjs.push(worker); + worker.on('online', onOnline); + worker.on('message', onMessage); + } + + function onOnline() { + if (++readies === workers) { + bench.start(); + broadcast(); + } + } + + function broadcast() { + if (broadcasts++ === n) { + bench.end(n); + for (const worker of workerObjs) { + worker.unref(); + } + return; + } + for (const worker of workerObjs) { + for (var i = 0; i < sends; ++i) + worker.postMessage(payload); + } + } + + function onMessage() { + if (++msgCount === expectedPerBroadcast) { + msgCount = 0; + broadcast(); + } + } +} diff --git a/common.gypi b/common.gypi index 641aa90b17c1d3..dbf49d11ce3279 100644 --- a/common.gypi +++ b/common.gypi @@ -27,7 +27,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.7', + 'v8_embedder_string': '-node.8', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, diff --git a/configure b/configure index dcc7f594c8c26a..f72e9123b90b0f 100755 --- a/configure +++ b/configure @@ -667,15 +667,17 @@ def get_llvm_version(cc): def get_xcode_version(cc): return get_version_helper( - cc, r"(^Apple LLVM version) ([5-9]\.[0-9]+)") + cc, r"(^Apple LLVM version) ([0-9]+\.[0-9]+)") def get_gas_version(cc): try: + custom_env = os.environ.copy() + custom_env["LC_ALL"] = "C" proc = subprocess.Popen(shlex.split(cc) + ['-Wa,-v', '-c', '-o', '/dev/null', '-x', 'assembler', '/dev/null'], stdin=subprocess.PIPE, stderr=subprocess.PIPE, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, env=custom_env) except OSError: error('''No acceptable C compiler found! @@ -683,12 +685,13 @@ def get_gas_version(cc): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", - proc.communicate()[1]) + gas_ret = proc.communicate()[1] + match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret) if match: return match.group(1) else: + warn('Could not recognize `gas`: ' + gas_ret) return '0' # Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes diff --git a/deps/node-inspect/.eslintrc b/deps/node-inspect/.eslintrc index de2b4fb28bc6cf..b6d45aa499655b 100644 --- a/deps/node-inspect/.eslintrc +++ b/deps/node-inspect/.eslintrc @@ -5,7 +5,7 @@ env: es6: true parserOptions: - ecmaVersion: 2016 + ecmaVersion: 2017 rules: # Possible Errors @@ -139,3 +139,9 @@ globals: DTRACE_HTTP_SERVER_RESPONSE: false DTRACE_NET_SERVER_CONNECTION: false DTRACE_NET_STREAM_END: false + LTTNG_HTTP_CLIENT_REQUEST: false + LTTNG_HTTP_CLIENT_RESPONSE: false + LTTNG_HTTP_SERVER_REQUEST: false + LTTNG_HTTP_SERVER_RESPONSE: false + LTTNG_NET_SERVER_CONNECTION: false + LTTNG_NET_STREAM_END: false diff --git a/deps/node-inspect/.npmrc b/deps/node-inspect/.npmrc index 38f11c645a0019..b7c8444fee52a6 100644 --- a/deps/node-inspect/.npmrc +++ b/deps/node-inspect/.npmrc @@ -1 +1,2 @@ registry=https://registry.npmjs.org +package-lock=false diff --git a/deps/node-inspect/CHANGELOG.md b/deps/node-inspect/CHANGELOG.md index 0db3a7842eb15d..44ae510efefd90 100644 --- a/deps/node-inspect/CHANGELOG.md +++ b/deps/node-inspect/CHANGELOG.md @@ -1,3 +1,17 @@ +### 1.11.5 + +* Fix eslint issues - **[@jkrems](https://github.com/jkrems)** [#63](https://github.com/nodejs/node-inspect/pull/63) + - [`2adadbc`](https://github.com/nodejs/node-inspect/commit/2adadbc1086d2e374c425acbf96260a122705db2) **style:** Fix eslint issues + - [`a6d2f88`](https://github.com/nodejs/node-inspect/commit/a6d2f882c026409696a1b063ff40ceba7e1ddb86) **doc:** Remove redundant newline at the end + + +### 1.11.4 + +* Handle blocked port - **[@jkrems](https://github.com/jkrems)** [#62](https://github.com/nodejs/node-inspect/pull/62) + - [`3388969`](https://github.com/nodejs/node-inspect/commit/3388969d0032a78ff0cdb8146f170b978ec13b7b) **chore:** Disable package-lock + - [`d278b23`](https://github.com/nodejs/node-inspect/commit/d278b233ae5e11a2b62d01ccbaae594f39b32a96) **fix:** Stop asking to report a blocked port - see: [#60](https://github.com/nodejs/node-inspect/issues/60) + + ### 1.11.3 * [`93caa0f`](https://github.com/nodejs/node-inspect/commit/93caa0f5267c7ab452b258d3b03329a0bb5ac7f7) **docs:** Add missing oc in protocol diff --git a/deps/node-inspect/lib/_inspect.js b/deps/node-inspect/lib/_inspect.js index d846efbe6a4a52..305e49915a467b 100644 --- a/deps/node-inspect/lib/_inspect.js +++ b/deps/node-inspect/lib/_inspect.js @@ -42,6 +42,13 @@ const [ InspectClient, createRepl ] = const debuglog = util.debuglog('inspect'); +class StartupError extends Error { + constructor(message) { + super(message); + this.name = 'StartupError'; + } +} + function portIsFree(host, port, timeout = 2000) { if (port === 0) return Promise.resolve(); // Binding to a random port. @@ -51,7 +58,7 @@ function portIsFree(host, port, timeout = 2000) { return new Promise((resolve, reject) => { setTimeout(() => { didTimeOut = true; - reject(new Error( + reject(new StartupError( `Timeout (${timeout}) waiting for ${host}:${port} to be free`)); }, timeout); @@ -346,10 +353,14 @@ function startInspect(argv = process.argv.slice(2), stdin.resume(); function handleUnexpectedError(e) { - console.error('There was an internal error in node-inspect. ' + - 'Please report this bug.'); - console.error(e.message); - console.error(e.stack); + if (!(e instanceof StartupError)) { + console.error('There was an internal error in node-inspect. ' + + 'Please report this bug.'); + console.error(e.message); + console.error(e.stack); + } else { + console.error(e.message); + } if (inspector.child) inspector.child.kill(); process.exit(1); } diff --git a/deps/node-inspect/package.json b/deps/node-inspect/package.json index d25376b5d4bb96..eddc14debc4066 100644 --- a/deps/node-inspect/package.json +++ b/deps/node-inspect/package.json @@ -1,6 +1,6 @@ { "name": "node-inspect", - "version": "1.11.3", + "version": "1.11.5", "description": "Node Inspect", "license": "MIT", "main": "lib/_inspect.js", diff --git a/deps/node-inspect/test/cli/invalid-args.test.js b/deps/node-inspect/test/cli/invalid-args.test.js index c831d799a0bdc5..c1aaeb6a9ce750 100644 --- a/deps/node-inspect/test/cli/invalid-args.test.js +++ b/deps/node-inspect/test/cli/invalid-args.test.js @@ -1,4 +1,7 @@ 'use strict'; +const Path = require('path'); +const { createServer } = require('net'); + const { test } = require('tap'); const startCLI = require('./start-cli'); @@ -23,3 +26,29 @@ test('launch w/ invalid host:port', (t) => { t.equal(code, 1, 'exits with non-zero exit code'); }); }); + +test('launch w/ unavailable port', async (t) => { + const blocker = createServer((socket) => socket.end()); + const port = await new Promise((resolve, reject) => { + blocker.on('error', reject); + blocker.listen(0, '127.0.0.1', () => resolve(blocker.address().port)); + }); + + try { + const script = Path.join('examples', 'three-lines.js'); + const cli = startCLI([`--port=${port}`, script]); + const code = await cli.quit(); + + t.notMatch( + cli.output, + 'report this bug', + 'Omits message about reporting this as a bug'); + t.match( + cli.output, + `waiting for 127.0.0.1:${port} to be free`, + 'Tells the user that the port wasn\'t available'); + t.equal(code, 1, 'exits with non-zero exit code'); + } finally { + blocker.close(); + } +}); diff --git a/deps/openssl/openssl/crypto/dh/dh_key.c b/deps/openssl/openssl/crypto/dh/dh_key.c index fce9ff47f3670f..58003d708781f3 100644 --- a/deps/openssl/openssl/crypto/dh/dh_key.c +++ b/deps/openssl/openssl/crypto/dh/dh_key.c @@ -78,10 +78,15 @@ static int generate_key(DH *dh) int ok = 0; int generate_new_key = 0; unsigned l; - BN_CTX *ctx; + BN_CTX *ctx = NULL; BN_MONT_CTX *mont = NULL; BIGNUM *pub_key = NULL, *priv_key = NULL; + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { + DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE); + return 0; + } + ctx = BN_CTX_new(); if (ctx == NULL) goto err; diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 649deb515aa395..440a6068699ef0 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 6 #define V8_MINOR_VERSION 7 #define V8_BUILD_NUMBER 288 -#define V8_PATCH_LEVEL 45 +#define V8_PATCH_LEVEL 46 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index dcee4eed4e8bc4..ab77238a77f97f 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1578,6 +1578,9 @@ class V8_EXPORT ScriptCompiler { * This will return nullptr if the script cannot be serialized. The * CachedData returned by this function should be owned by the caller. */ + static CachedData* CreateCodeCache(Local unbound_script); + + // Deprecated. static CachedData* CreateCodeCache(Local unbound_script, Local source); @@ -1587,6 +1590,9 @@ class V8_EXPORT ScriptCompiler { * This will return nullptr if the script cannot be serialized. The * CachedData returned by this function should be owned by the caller. */ + static CachedData* CreateCodeCacheForFunction(Local function); + + // Deprecated. static CachedData* CreateCodeCacheForFunction(Local function, Local source); diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 25506d3930868d..e9a5ec69ec4a71 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -2626,21 +2626,29 @@ uint32_t ScriptCompiler::CachedDataVersionTag() { ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCache( Local unbound_script, Local source) { + return CreateCodeCache(unbound_script); +} + +ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCache( + Local unbound_script) { i::Handle shared = i::Handle::cast( Utils::OpenHandle(*unbound_script)); - i::Handle source_str = Utils::OpenHandle(*source); DCHECK(shared->is_toplevel()); - return i::CodeSerializer::Serialize(shared, source_str); + return i::CodeSerializer::Serialize(shared); } ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCacheForFunction( Local function, Local source) { + return CreateCodeCacheForFunction(function); +} + +ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCacheForFunction( + Local function) { i::Handle shared( i::Handle::cast(Utils::OpenHandle(*function))->shared()); - i::Handle source_str = Utils::OpenHandle(*source); CHECK(shared->is_wrapped()); - return i::CodeSerializer::Serialize(shared, source_str); + return i::CodeSerializer::Serialize(shared); } MaybeLocal