0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
Commit Graph

28397 Commits

Author SHA1 Message Date
Beth Griggs
42bf0c8df2
2019-10-22, Version 13.0.0 (Current)
Notable changes:

* assert:
  * If the validation function passed to `assert.throws()` or
    `assert.rejects()` returns a value other than `true`, an assertion
    error will be thrown instead of the original error to highlight the
    programming mistake (Ruben Bridgewater).
    https://github.com/nodejs/node/pull/28263
  * If a constructor function is passed to validate the instance of
    errors thrown in `assert.throws()` or `assert.reject()`, an
    assertion error will be thrown instead of the original error
    (Ruben Bridgewater).
    https://github.com/nodejs/node/pull/28263
* build:
  * Node.js releases are now built with default full-icu support. This
    means that all locales supported by ICU are now included and
    Intl-related APIs may return different values than before
    (Richard Lau).
    https://github.com/nodejs/node/pull/29887
  * The minimum Xcode version supported for macOS was increased to 10.
    It is still possible to build Node.js with Xcode 8 but this may no
    longer be the case in a future v13.x release (Michael Dawson).
    https://github.com/nodejs/node/pull/29622
* child_process:
  * `ChildProcess._channel` (DEP0129) is now a Runtime deprecation
    (cjihrig).
    https://github.com/nodejs/node/pull/27949
* console:
  * The output `console.timeEnd()` and `console.timeLog()` will now
    automatically select a suitable time unit instead of always using
    milliseconds (Xavier Stouder).
    https://github.com/nodejs/node/pull/29251
* deps:
  * The V8 engine was updated to version 7.8. This includes performance
    improvements to object destructuring, memory usage and WebAssembly
    startup time (Myles Borins).
    https://github.com/nodejs/node/pull/29694)
* domain:
  * The domain's error handler is now executed with the active domain
    set to the domain's parent to prevent inner recursion
    (Julien Gilli).
    https://github.com/nodejs/node/pull/26211
* fs:
  * The undocumented method `FSWatcher.prototype.start()` was removed
    (Lucas Holmquist).
    https://github.com/nodejs/node/pull/29905
  * Calling the `open()` method on a `ReadStream` or `WriteStream` now
    emits a runtime deprecation warning. The methods are supposed to be
    internal and should not be called by user code (Robert Nagy).
    https://github.com/nodejs/node/pull/29061
  * `fs.read/write`, `fs.readSync/writeSync` and `fd.read/write` now
    accept any safe integer as their `offset` parameter. The value of
    `offset` is also no longer coerced, so a valid type must be passed
    to the functions (Zach Bjornson).
    https://github.com/nodejs/node/pull/26572
* http:
  * Aborted requests no longer emit the `end` or `error` events after
    `aborted` (Robert Nagy).
    https://github.com/nodejs/node/pull/27984
    https://github.com/nodejs/node/pull/20077
  * Data will no longer be emitted after a socket error (Robert Nagy).
    https://github.com/nodejs/node/pull/28711
  * The legacy HTTP parser (previously available under the
    `--http-parser=legacy` flag) was removed (Anna Henningsen).
    https://github.com/nodejs/node/pull/29589
  * The `host` option for HTTP requests is now validated to be a string
    value (Giorgos Ntemiris).
    https://github.com/nodejs/node/pull/29568
  * The `request.connection` and `response.connection` properties are now
    runtime deprecated. The equivalent `request.socket` and `response.socket`
    should be used instead (Robert Nagy).
    https://github.com/nodejs/node/pull/29015
* http, http2:
  * The default server timeout was removed (Ali Ijaz Sheikh).
    https://github.com/nodejs/node/pull/27558
  * Brought 425 status code name into accordance with RFC 8470. The name
    changed from "Unordered Collection" to "Too Early" (Sergei Osipov).
    https://github.com/nodejs/node/pull/29880
* lib:
  * The `error.errno` property will now always be a number. To get the
    string value, use `error.code` instead (Joyee Cheung).
    https://github.com/nodejs/node/pull/28140
* module:
  * `module.createRequireFromPath()` is deprecated. Use
    `module.createRequire()` instead (cjihrig).
    https://github.com/nodejs/node/pull/27951
* src:
  * Changing the value of `process.env.TZ` will now clear the tz cache.
    This affects the default time zone used by methods such as
    `Date.prototype.toString` (Ben Noordhuis).
    https://github.com/nodejs/node/pull/20026
* stream:
  * The timing and behavior of streams was consolidated for a number of
    edge cases. Please look at the individual commits below for more
    information.

PR-URL: https://github.com/nodejs/node/pull/29504
2019-10-22 17:12:12 +01:00
Anna Henningsen
31217a8e88 cli: add --trace-uncaught flag
Add a flag that makes Node.js print the stack trace at the
time of *throwing* uncaught exceptions, rather than at the
creation of the `Error` object, if there is any.

This is disabled by default because it affects GC behavior.

PR-URL: https://github.com/nodejs/node/pull/30025
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-22 08:16:18 +02:00
Shelley Vohr
71b342f937
src: fewer uses of NODE_USE_V8_PLATFORM
PR-URL: https://github.com/nodejs/node/pull/30029
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-10-21 14:10:18 +02:00
Michaël Zasso
701933ca8f
2019-10-21, Version 12.13.0 'Erbium' (LTS)
This release marks the transition of Node.js 12.x into Long Term Support
(LTS) with the codename 'Erbium'. The 12.x release line now moves into
"Active LTS" and will remain so until October 2020. After that time, it
will move into "Maintenance" until end of life in April 2022.

Notable changes:

npm was updated to 6.12.0. It now includes a version of `node-gyp` that
supports Python 3 for building native modules.

PR-URL: https://github.com/nodejs/node/pull/29981
2019-10-21 11:12:52 +02:00
Daniel Bevenius
a5bab21458 src: remove unused iomanip include
This commit removes the include of the IO manipulators header as I can't
find that it is used anywhere.

PR-URL: https://github.com/nodejs/node/pull/30004
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-21 05:53:37 +02:00
cjihrig
7d433a936b
deps: upgrade to libuv 1.33.1
Notable changes:

- uv_random() has been added.
- More work to read those pesky Windows
  environment variables.
- Several build fixes for Tier 3 platforms (Android,
  NetBSD, OpenBSD, Haiku).
- Stop using fsevents to watch files (using kqueue again).

PR-URL: https://github.com/nodejs/node/pull/29996
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-20 10:13:31 -05:00
Michaël Zasso
0822bfaa9f
build: make configure --without-snapshot a no-op
From V8 7.9, the option will no longer exist upstream.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1796325

PR-URL: https://github.com/nodejs/node/pull/30021
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-20 16:45:35 +02:00
Michaël Zasso
b554214249
build: default Windows build to Visual Studio 2019
Building and testing Node.js with Visual Studio 2019 is now working as
expected.
Fallback to VS 2017 if VS 2019 was not found.

Fixes: https://github.com/nodejs/node/issues/27214

PR-URL: https://github.com/nodejs/node/pull/30022
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2019-10-20 16:08:15 +02:00
Michaël Zasso
a4e075f668
test: fix test runner for Python 3 on Windows
Explicitly open files with utf8 encoding, otherwise the system could use
another encoding such as latin1 by default.

PR-URL: https://github.com/nodejs/node/pull/30023
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-20 16:06:39 +02:00
Minwoo Jung
425357a11c doc: update collaborator email address
update collaborator email address

PR-URL: https://github.com/nodejs/node/pull/30007
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-19 14:10:06 +09:00
Sam Roberts
8425183e0b src: initialize openssl only once
For compatibility with OpenSSL 1.1.0 and 1.0.1 a series of
initialization wrappers were being called, many deprecated, and many
calling each other internally already. Compatibility is unnecessary in
12.x and later, which support only OpenSSL 1.1.1, and the multiple calls
cause the configuration file to be loaded multiple times.

Fixes: https://github.com/nodejs/node/issues/29702

See:
- https://mta.openssl.org/pipermail/openssl-users/2019-October/011303.html
- https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_init_ssl.html
- https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_init_crypto.html

PR-URL: https://github.com/nodejs/node/pull/29999
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2019-10-18 21:25:03 -07:00
Christian Clauss
d594a9a798 build: use python3 to build and test on Travis
Request Python 3 with pyenv and ensure that python3 is used by Makefile
to run Python scripts.

PR-URL: https://github.com/nodejs/node/pull/29451
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2019-10-18 11:40:42 -07:00
Rich Trott
fa2ba05bcd test: remove common.skipIfInspectorEnabled()
common.skipIfInspectorEnabled() is only used once in all of the tests.
The test is more clear (in my opinion, at least) without the abstraction
so put the check directly in the test. Additionally, it honestly looks
like an error (which is how I noticed it in the first place) and that
someone mistyped the far more common skipIfInspectorDisabled().

PR-URL: https://github.com/nodejs/node/pull/29993
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-18 11:32:04 -07:00
Rich Trott
ce72cd779a doc: make YAML matter consistent in crypto.md
This fixes YAML that gets incorrectly processed by our tooling.

Refs: https://github.com/nodejs/node/pull/29910#issuecomment-543237767

PR-URL: https://github.com/nodejs/node/pull/30016
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-18 09:11:25 -07:00
akitsu-sanae
05c8977a6e doc: fix tls version typo
PR-URL: https://github.com/nodejs/node/pull/29984
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-10-18 16:56:47 +05:30
Michaël Zasso
d769ebc2b7
build: fix version checks in configure.py
Fixes: https://github.com/nodejs/node/issues/29927
Refs: https://github.com/nodejs/node/pull/29931

PR-URL: https://github.com/nodejs/node/pull/29965
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-10-18 09:29:15 +02:00
Richard Lau
c8df5cf74a build: build benchmark addons like test addons
Build the addons for benchmarks in the same way that the addons for
tests are built.

PR-URL: https://github.com/nodejs/node/pull/29995
Fixes: https://github.com/nodejs/build/issues/1961
Refs: 53ca0b9ae1 (commitcomment-35494896)
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-10-17 01:28:51 -04:00
Myles Borins
1e5ed9a5db esm: modify resolution order for specifier flag
Currently `--es-module-specifier-resolution=node` has an alternative
resolution order than the default in common.js, this causes
inconsistencies. As discussed in @nodejs/modules we want to preserve
resolution order between implementations.

PR-URL: https://github.com/nodejs/node/pull/29974
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-16 22:01:19 -04:00
Bradley Farias
a6b030d5ac module: refactor modules bootstrap
PR-URL: https://github.com/nodejs/node/pull/29937
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-10-16 21:50:05 -04:00
Lucas Pardue
1784b7fafa
dgram: add source-specific multicast support
This adds RFC 4607 support for IPv4 and IPv6.

Co-Authored-By: Nicolas Thumann <46975855+n-thumann@users.noreply.github.com>
Co-Authored-By: Rich Trott <rtrott@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/15735
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-17 03:12:53 +02:00
Robert Nagy
273d38b198 doc: clarify readable.unshift null/EOF
PR-URL: https://github.com/nodejs/node/pull/29950
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-10-16 13:04:55 -07:00
Gabriel Schulhof
1599aeb08d src: refine maps parsing for large pages
Multiple sections may be marked as "r-xp" and with the executable's
path. We use the location of the `__nodetext` symbol added by the linker
script to ensure that the range we retrieve from the maps file does
indeed contain the Node.js text section.

Thanks to Suresh Srinivas <suresh.srinivas@intel.com>!

PR-URL: https://github.com/nodejs/node/pull/29973
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-10-16 12:35:00 -07:00
Ben Noordhuis
9f203f927c crypto: add Hash.prototype.copy() method
Make it possible to clone the internal state of a Hash object
into a new Hash object, i.e., to fork the state of the object.

Fixes: https://github.com/nodejs/node/issues/29903

PR-URL: https://github.com/nodejs/node/pull/29910
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-16 10:00:00 -07:00
Matteo Rossi
e22efba812 test: add cb error test for fs.close()
Provides some missing test coverage.

PR-URL: https://github.com/nodejs/node/pull/29970
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-16 09:52:07 -07:00
Nick Schonning
46648eb55d doc: remove unused Markdown reference links
PR-URL: https://github.com/nodejs/node/pull/29961
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-15 23:17:26 -07:00
Nick Schonning
d1eb108d72 doc: re-enable passing remark-lint rule
PR-URL: https://github.com/nodejs/node/pull/29961
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-10-15 23:17:24 -07:00
Huachao Mao
405a280cf2 doc: add server header into the discarded list of http message.headers
PR-URL: https://github.com/nodejs/node/pull/29962
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-10-15 22:35:50 -07:00
cjihrig
ff5a1cf5a8 doc: add missing deprecation code
Refs: https://github.com/nodejs/node/pull/29061

PR-URL: https://github.com/nodejs/node/pull/29969
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-10-15 22:19:16 -07:00
Robert Nagy
d247a8e1dc http: emit close on socket re-use
PR-URL: https://github.com/nodejs/node/pull/28685
Refs: https://github.com/nodejs/node/issues/28684
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-10-15 16:51:09 -07:00
Rich Trott
90b5f1b107 tools: update remark-preset-lint-node to 1.10.1
This includes better link linting, improved prohibited string linting,
and a more maintainable code base by using remark-preset-int-recommended
(thanks nschonni!).

Update other dependencies while at it.

PR-URL: https://github.com/nodejs/node/pull/29982
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-15 13:25:26 -07:00
Rich Trott
c4de76f7a6 doc: update vm.md for link linting
Update vm.md for link linting rules that are about to be applied. Define
an undefined link reference. Escape non-link text that uses `[` and `]`.

PR-URL: https://github.com/nodejs/node/pull/29982
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-15 13:25:23 -07:00
Rich Trott
f4f856b238 test: fix flaky doctool and test
Doctool tests have been failing a lot in CI on Win2008 R2. It appears
async functions and callback-based functions are being used in
combination such that the callback-based function cannot guarantee that
it will invoke its callback. Convert the callback-based functions to
async functions so we have one paradigm and reliable results.

PR-URL: https://github.com/nodejs/node/pull/29979
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-10-15 13:22:41 -07:00
isaacs
3ebaf6b9bc deps: update npm to 6.12.0
Update npm to 6.12.0

Now `npm ci` runs prepare scripts for git dependencies, and respects the
`--no-optional` argument.  Warnings for `engine` mismatches are printed
again.  Various other fixes and cleanups.

PR-URL: https://github.com/nodejs/node/pull/29885
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
2019-10-15 11:00:21 -07:00
Rich Trott
ed5eaa0495 doc: prepare miscellaneous docs for new markdown lint rules
Prepare the final few documents that haven't been updated to always use
`[]` with reference links and to escape `[` and `]` for things that
aren't links in markdown files.

PR-URL: https://github.com/nodejs/node/pull/29963
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-10-15 06:39:52 -07:00
legendecas
6afed1dc85 n-api: add napi_detach_arraybuffer
As ArrayBuffer#detach is an ecma spec operation
([Section 24.1.1.3](https://tc39.es/ecma262/#sec-detacharraybuffer)),
it might be good to have it in N-API.

Fixes https://github.com/nodejs/node/issues/29674

PR-URL: https://github.com/nodejs/node/pull/29768
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2019-10-14 16:05:58 -07:00
Gus Caplan
f9caee986c vm: add Synthetic modules
- Refactor vm.SourceTextModule (again)
- Add vm.Module abstract superclass
- Add vm.SyntheticModule

Refs: https://heycam.github.io/webidl/#synthetic-module-records

PR-URL: https://github.com/nodejs/node/pull/29864
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2019-10-14 14:25:38 -07:00
Rich Trott
7991b57cfd test: fix fs benchmark test
Add missing option "mode". Alphabetize options for easier maintenance.

PR-URL: https://github.com/nodejs/node/pull/29967
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-10-14 07:53:51 -07:00
Unlocked
c62503994a
doc: fix --enable-source-maps flag in v12.12.0 changelog
Corrects "--source-map-support" to "--enable-source-maps".

Fixes: https://github.com/nodejs/node/issues/29959
PR-URL: https://github.com/nodejs/node/pull/29960
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-10-14 15:00:10 +02:00
Robert Nagy
5f80df8820 http: do not emit end after aborted
IncomingMessage will no longer emit end after aborted.

PR-URL: https://github.com/nodejs/node/pull/27984
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-13 19:04:44 -07:00
bcoe
4ca61f40fe process: add lineLength to source-map-cache
Without the line lengths of in-memory transpiled source, it's not
possible to convert from byte ofsets to line/column offsets.

PR-URL: https://github.com/nodejs/node/pull/29863
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-13 18:58:21 -07:00
Robert Nagy
f8f6a21580 stream: throw unhandled error for readable with autoDestroy
If autoDestroy then we should still throw on unhandled
errors.

PR-URL: https://github.com/nodejs/node/pull/29806
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Co-Authored-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-10-13 16:38:15 -07:00
Robert Nagy
ba45367830 fs: do not emit 'finish' before 'open' on write empty file
'finish' could previously be emitted before the file has been
created when ending a write stream without having written any
data.

Refs: https://github.com/expressjs/multer/issues/238

PR-URL: https://github.com/nodejs/node/pull/29930
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-10-13 16:22:23 -07:00
Ben Noordhuis
6f814013f4 build: fix version checks in gyp files
Make `distutils.version.StrictVersion` available as a helper to
gyp expressions so they can do proper version checks and update
the gyp files accordingly.

Caveat emptor: `StrictVersion` does *not* like empty strings so
this commit adds truthiness guards. The helper could deal with
those but I felt it better to make it explicit.

Fixes: https://github.com/nodejs/node/issues/29927

PR-URL: https://github.com/nodejs/node/pull/29931
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-13 16:20:22 -07:00
Gus Caplan
545f7282d1
src: implement v8 host weakref hooks
PR-URL: https://github.com/nodejs/node/pull/29874
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-10-13 15:45:36 -07:00
Gus Caplan
ea3d5ff785
tools: fix test runner in presence of NODE_REPL_EXTERNAL_MODULE
PR-URL: https://github.com/nodejs/node/pull/29956
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-10-13 13:41:25 -07:00
Michaël Zasso
8728f8660a
tools: fix GYP MSVS solution generator for Python 3
PR-URL: https://github.com/nodejs/node/pull/29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-10-13 20:28:19 +02:00
Michaël Zasso
6c205aba00
build: always use strings for compiler version in gyp files
If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.

PR-URL: https://github.com/nodejs/node/pull/29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-10-13 20:28:17 +02:00
Michaël Zasso
66b953207d
tools: port Python 3 compat patches from node-gyp to gyp
Refs: https://github.com/nodejs/node-gyp/pull/1820
Refs: https://github.com/nodejs/node-gyp/pull/1843

PR-URL: https://github.com/nodejs/node/pull/29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-10-13 20:28:08 +02:00
Michaël Zasso
7de5a55710
deps: patch V8 to 7.8.279.17
Refs: https://github.com/v8/v8/compare/7.8.279.15...7.8.279.17

PR-URL: https://github.com/nodejs/node/pull/29928
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-10-13 20:25:13 +02:00
Gabriel Schulhof
53ca0b9ae1 src: render N-API weak callbacks as cleanup hooks
Since worker threads are complete Node.js environments, including the
ability to load native addons, and since those native addons can
allocate resources to be freed when objects go out of scope, and since,
upon worker thread exit, the engine does not invoke the weak callbacks
responsible for freeing resources which still have references, this
modification introduces tracking for weak references such that a list
of outstanding weak references is maintained. This list is traversed
during environment teardown. The callbacks for the remaining weak
references are called.

This change is also relevant for Node.js embedder scenarios, because in
those cases the process also outlives the `node::Environment` and
therefore weak callbacks should also be rendered as environment cleanup
hooks to ensure proper cleanup after native addons. This changes
introduces the means by which this can be accomplished.

A benchmark is included which measures the time it takes to execute the
weak reference callback for a given number of weak references.

Re: https://github.com/tc39/proposal-weakrefs/issues/125#issuecomment-535832130
PR-URL: https://github.com/nodejs/node/pull/28428
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-10-13 00:07:43 -07:00