-9.7.0
+9.8.0
+9.7.1
+9.7.0 9.6.1 9.6.0 9.5.0
diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js
index cd1debd4df6..9f025c922ad 100644
--- a/benchmark/querystring/querystring-stringify.js
+++ b/benchmark/querystring/querystring-stringify.js
@@ -17,7 +17,7 @@ function main({ type, n }) {
encodemany: {
'\u0080\u0083\u0089': 'bar',
'\u008C\u008E\u0099': 'quux',
- xyzzy: '\u00A5q\u00A3r'
+ 'xyzzy': '\u00A5q\u00A3r'
},
encodelast: {
foo: 'bar',
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 2a1474f33ff..840a6cad3b6 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -237,7 +237,7 @@ tracing is enabled using `--trace-events-enabled`.
### `--trace-event-file-pattern`
Template string specifying the filepath for the trace event data, it
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md
index 4eb90c4c38c..b3b316f1a35 100644
--- a/doc/api/deprecations.md
+++ b/doc/api/deprecations.md
@@ -915,7 +915,6 @@ Type: Runtime
This was never a documented feature.
-
### DEP0101: --with-lttng
@@ -940,6 +939,17 @@ Type: Documentation-only (supports [`--pending-deprecation`][])
Using `process.binding()` in general should be avoided. The type checking
methods in particular can be replaced by using [`util.types`][].
+
+### DEP0104: process.env string coercion
+
+Type: Documentation-only (supports [`--pending-deprecation`][])
+
+Currently when assigning a property to [`process.env`][], the assigned value is
+implicitly converted to a string if it is not a string. This behavior is
+deprecated if the assigned value is not a string, boolean, or number. In the
+future, such assignment may result in a thrown error. Please convert the
+property to a string before assigning it to `process.env`.
+
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
@@ -976,6 +986,7 @@ methods in particular can be replaced by using [`util.types`][].
[`fs.stat()`]: fs.html#fs_fs_stat_path_callback
[`os.networkInterfaces`]: os.html#os_os_networkinterfaces
[`os.tmpdir()`]: os.html#os_os_tmpdir
+[`process.env`]: process.html#process_process_env
[`punycode`]: punycode.html
[`require.extensions`]: modules.html#modules_require_extensions
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args
diff --git a/doc/api/inspector.md b/doc/api/inspector.md
index b6f702f0dd5..c801510b756 100644
--- a/doc/api/inspector.md
+++ b/doc/api/inspector.md
@@ -136,8 +136,34 @@ with an error. [`session.connect()`] will need to be called to be able to send
messages again. Reconnected session will lose all inspector state, such as
enabled agents or configured breakpoints.
+## Example usage
+
+### CPU Profiler
+
+Apart from the debugger, various V8 Profilers are available through the DevTools
+protocol. Here's a simple example showing how to use the [CPU profiler][]:
+
+```js
+const inspector = require('inspector');
+
+const session = new inspector.Session();
+session.connect();
+
+session.post('Profiler.enable', () => {
+ session.post('Profiler.start', () => {
+ // invoke business logic under measurement here...
+
+ // some time later...
+ session.post('Profiler.stop', ({ profile }) => {
+ // write profile to disk, upload, etc.
+ });
+ });
+});
+```
+
[`session.connect()`]: #inspector_session_connect
[`Debugger.paused`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger/#event-paused
[`EventEmitter`]: events.html#events_class_eventemitter
[Chrome DevTools Protocol Viewer]: https://chromedevtools.github.io/devtools-protocol/v8/
+[CPU Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/Profiler
diff --git a/doc/api/process.md b/doc/api/process.md
index 2bd7a119bf8..e89e5c0281a 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -836,6 +836,10 @@ emitMyWarning();
## process.env
* {Object}
@@ -877,7 +881,8 @@ console.log(process.env.foo);
```
Assigning a property on `process.env` will implicitly convert the value
-to a string.
+to a string. **This behavior is deprecated.** Future versions of Node.js may
+throw an error when the value is not a string, number, or boolean.
Example:
diff --git a/doc/api/repl.md b/doc/api/repl.md
index c868106f2f9..233977fe09c 100644
--- a/doc/api/repl.md
+++ b/doc/api/repl.md
@@ -144,7 +144,7 @@ global or scoped variable, the input `fs` will be evaluated on-demand as
#### Assignment of the `_` (underscore) variable
diff --git a/doc/changelogs/CHANGELOG_V9.md b/doc/changelogs/CHANGELOG_V9.md
index 37b34de0dc6..d4ad1d9cbc8 100644
--- a/doc/changelogs/CHANGELOG_V9.md
+++ b/doc/changelogs/CHANGELOG_V9.md
@@ -9,6 +9,7 @@
+9.8.0 9.7.1 9.7.0 9.6.1
@@ -35,6 +36,99 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)
+
+## 2018-03-07, Version 9.8.0 (Current), @MylesBorins
+
+### Notable Changes
+
+* **crypto**:
+ - add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson) [#17690](https://github.com/nodejs/node/pull/17690)
+* **http2**:
+ - Fixed issues with aborted connections in the HTTP/2 implementation (Anna Henningsen) [#18987](https://github.com/nodejs/node/pull/18987) [#19002](https://github.com/nodejs/node/pull/19002)
+* **loader**:
+ - --inspect-brk now works properly for esmodules (Gus Caplan) [#18949](https://github.com/nodejs/node/pull/18949)
+* **src**:
+ - make process.dlopen() load well-known symbol (Ben Noordhuis) [#18934](https://github.com/nodejs/node/pull/18934)
+* **trace_events**:
+ - add file pattern cli option (Andreas Madsen) [#18480](https://github.com/nodejs/node/pull/18480)
+* **Added new collaborators**
+ - [MoonBall](https://github.com/MoonBall) Chen Gang
+
+### Commits
+
+* [[`6ae2cafde3`](https://github.com/nodejs/node/commit/6ae2cafde3)] - **buffer**: coerce offset to integer (Ruben Bridgewater) [#18215](https://github.com/nodejs/node/pull/18215)
+* [[`6d17383041`](https://github.com/nodejs/node/commit/6d17383041)] - **buffer**: fix typo in lib/buffer.js (Ujjwal Sharma) [#19126](https://github.com/nodejs/node/pull/19126)
+* [[`4b34b2e185`](https://github.com/nodejs/node/commit/4b34b2e185)] - **build**: fix gocvr version used for coverage (Michael Dawson) [#19094](https://github.com/nodejs/node/pull/19094)
+* [[`a938e52ffe`](https://github.com/nodejs/node/commit/a938e52ffe)] - **build**: disable openssl build warnings on macos (Ben Noordhuis) [#19046](https://github.com/nodejs/node/pull/19046)
+* [[`44d80c5620`](https://github.com/nodejs/node/commit/44d80c5620)] - **build**: fix coverage after gcovr update (killagu) [#18958](https://github.com/nodejs/node/pull/18958)
+* [[`28a5362e83`](https://github.com/nodejs/node/commit/28a5362e83)] - **build**: fix lint-md-build dependency (Joyee Cheung) [#18981](https://github.com/nodejs/node/pull/18981)
+* [[`e74e422a53`](https://github.com/nodejs/node/commit/e74e422a53)] - **(SEMVER-MINOR)** **crypto**: add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson) [#17690](https://github.com/nodejs/node/pull/17690)
+* [[`056001dc8f`](https://github.com/nodejs/node/commit/056001dc8f)] - **(SEMVER-MINOR)** **deps**: cherry-pick 0bcb1d6f from upstream V8 (Jakob Kummerow) [#18212](https://github.com/nodejs/node/pull/18212)
+* [[`1fadb2edb4`](https://github.com/nodejs/node/commit/1fadb2edb4)] - **doc**: fix/add link to Android info (Vse Mozhet Byt) [#19004](https://github.com/nodejs/node/pull/19004)
+* [[`68524610f2`](https://github.com/nodejs/node/commit/68524610f2)] - **doc**: remove subsystem from pull request template (Rich Trott) [#19125](https://github.com/nodejs/node/pull/19125)
+* [[`d3a70e9cd4`](https://github.com/nodejs/node/commit/d3a70e9cd4)] - **doc**: remove tentativeness in pull-requests.md (Rich Trott) [#19123](https://github.com/nodejs/node/pull/19123)
+* [[`f03079fce6`](https://github.com/nodejs/node/commit/f03079fce6)] - **doc**: update cc list (Ruben Bridgewater) [#19099](https://github.com/nodejs/node/pull/19099)
+* [[`9d2de16b13`](https://github.com/nodejs/node/commit/9d2de16b13)] - **doc**: add introduced\_in metadata to \_toc.md (Rich Trott) [#19113](https://github.com/nodejs/node/pull/19113)
+* [[`ae2dabb8fc`](https://github.com/nodejs/node/commit/ae2dabb8fc)] - **doc**: new team for bundlers or delivery of Node.js (Michael Dawson) [#19098](https://github.com/nodejs/node/pull/19098)
+* [[`0e4f4266a1`](https://github.com/nodejs/node/commit/0e4f4266a1)] - **doc**: add simple example to rename function (punteek) [#18812](https://github.com/nodejs/node/pull/18812)
+* [[`e42600fc4b`](https://github.com/nodejs/node/commit/e42600fc4b)] - **doc**: add missing `Returns` in fs & util (Sho Miyamoto) [#18775](https://github.com/nodejs/node/pull/18775)
+* [[`4ecf5bbe74`](https://github.com/nodejs/node/commit/4ecf5bbe74)] - **doc**: fix a typo in util.isDeepStrictEqual (Sho Miyamoto) [#18775](https://github.com/nodejs/node/pull/18775)
+* [[`cab6c8e95c`](https://github.com/nodejs/node/commit/cab6c8e95c)] - **doc**: add URL.format() example (Zeke Sikelianos) [#18888](https://github.com/nodejs/node/pull/18888)
+* [[`a4462b7944`](https://github.com/nodejs/node/commit/a4462b7944)] - **doc**: fix n-api asynchronous threading docs (Eric Bickle) [#19073](https://github.com/nodejs/node/pull/19073)
+* [[`bfa894cf37`](https://github.com/nodejs/node/commit/bfa894cf37)] - **doc**: add MoonBall to collaborators (Chen Gang) [#19109](https://github.com/nodejs/node/pull/19109)
+* [[`77154cd65d`](https://github.com/nodejs/node/commit/77154cd65d)] - **doc**: update list of re-exported symbols (Richard Lau) [#19013](https://github.com/nodejs/node/pull/19013)
+* [[`459f2095a1`](https://github.com/nodejs/node/commit/459f2095a1)] - **doc**: Readable unpipe on Writable error event (George Sapkin) [#18080](https://github.com/nodejs/node/pull/18080)
+* [[`68c1337819`](https://github.com/nodejs/node/commit/68c1337819)] - **doc**: add RegExp Unicode Property Escapes to intl (Vse Mozhet Byt) [#19052](https://github.com/nodejs/node/pull/19052)
+* [[`71d09ecbf1`](https://github.com/nodejs/node/commit/71d09ecbf1)] - **doc**: make the background section concise and improve its formality (Wilson) [#18928](https://github.com/nodejs/node/pull/18928)
+* [[`951054004d`](https://github.com/nodejs/node/commit/951054004d)] - **doc**: lowercase primitives in test/common/README.md (Vse Mozhet Byt) [#18875](https://github.com/nodejs/node/pull/18875)
+* [[`5b8c97f6bc`](https://github.com/nodejs/node/commit/5b8c97f6bc)] - **events**: show throw stack trace for uncaught exception (Anna Henningsen) [#19003](https://github.com/nodejs/node/pull/19003)
+* [[`0789eeceb6`](https://github.com/nodejs/node/commit/0789eeceb6)] - **http**: prevent aborted event when already completed (Andrew Johnston) [#18999](https://github.com/nodejs/node/pull/18999)
+* [[`ae4d83facf`](https://github.com/nodejs/node/commit/ae4d83facf)] - **http**: prevent aborted event when already completed (Andrew Johnston) [#18999](https://github.com/nodejs/node/pull/18999)
+* [[`50d1233935`](https://github.com/nodejs/node/commit/50d1233935)] - **http2**: no stream destroy while its data is on the wire (Anna Henningsen) [#19002](https://github.com/nodejs/node/pull/19002)
+* [[`551d9752c8`](https://github.com/nodejs/node/commit/551d9752c8)] - **http2**: fix flaky test-http2-https-fallback (Matteo Collina) [#19093](https://github.com/nodejs/node/pull/19093)
+* [[`8bc930c269`](https://github.com/nodejs/node/commit/8bc930c269)] - **http2**: fix endless loop when writing empty string (Anna Henningsen) [#18924](https://github.com/nodejs/node/pull/18924)
+* [[`aa0fca9426`](https://github.com/nodejs/node/commit/aa0fca9426)] - **http2**: use original error for cancelling pending streams (Anna Henningsen) [#18988](https://github.com/nodejs/node/pull/18988)
+* [[`447136999d`](https://github.com/nodejs/node/commit/447136999d)] - **http2**: send error text in case of ALPN mismatch (Anna Henningsen) [#18986](https://github.com/nodejs/node/pull/18986)
+* [[`ef8f90f34e`](https://github.com/nodejs/node/commit/ef8f90f34e)] - **http2**: fix condition where data is lost (Matteo Collina) [#18895](https://github.com/nodejs/node/pull/18895)
+* [[`e584113b66`](https://github.com/nodejs/node/commit/e584113b66)] - **lib**: re-fix v8\_prof\_processor (Anna Henningsen) [#19059](https://github.com/nodejs/node/pull/19059)
+* [[`12856b0dd2`](https://github.com/nodejs/node/commit/12856b0dd2)] - **lib**: change hook -\> hooks in code comment (Daniel Bevenius) [#19053](https://github.com/nodejs/node/pull/19053)
+* [[`db8d197e79`](https://github.com/nodejs/node/commit/db8d197e79)] - **lib,test**: remove yoda statements (Ruben Bridgewater) [#18746](https://github.com/nodejs/node/pull/18746)
+* [[`59547cc438`](https://github.com/nodejs/node/commit/59547cc438)] - **loader**: fix --inspect-brk (Gus Caplan) [#18949](https://github.com/nodejs/node/pull/18949)
+* [[`39e032fe86`](https://github.com/nodejs/node/commit/39e032fe86)] - **module**: fix main lookup regression from #18728 (Guy Bedford) [#18788](https://github.com/nodejs/node/pull/18788)
+* [[`f3e3429296`](https://github.com/nodejs/node/commit/f3e3429296)] - **module**: support main w/o extension, pjson cache (Guy Bedford) [#18728](https://github.com/nodejs/node/pull/18728)
+* [[`95f6467ffd`](https://github.com/nodejs/node/commit/95f6467ffd)] - **module**: fix cyclical dynamic import (Bradley Farias) [#18965](https://github.com/nodejs/node/pull/18965)
+* [[`5c4f703607`](https://github.com/nodejs/node/commit/5c4f703607)] - **n-api**: update reference test (Gabriel Schulhof) [#19086](https://github.com/nodejs/node/pull/19086)
+* [[`1b32fc3276`](https://github.com/nodejs/node/commit/1b32fc3276)] - **n-api**: fix object test (Gabriel Schulhof) [#19039](https://github.com/nodejs/node/pull/19039)
+* [[`ef4714c2b6`](https://github.com/nodejs/node/commit/ef4714c2b6)] - **net**: inline and simplify onSocketEnd (Anna Henningsen) [#18607](https://github.com/nodejs/node/pull/18607)
+* [[`28880cf89d`](https://github.com/nodejs/node/commit/28880cf89d)] - **perf_hooks**: fix timing (Timothy Gu) [#18993](https://github.com/nodejs/node/pull/18993)
+* [[`96f0bec48b`](https://github.com/nodejs/node/commit/96f0bec48b)] - **repl**: make last error available as `\_error` (Anna Henningsen) [#18919](https://github.com/nodejs/node/pull/18919)
+* [[`420d56c2ea`](https://github.com/nodejs/node/commit/420d56c2ea)] - **src**: don't touch js object in Http2Session dtor (Ben Noordhuis) [#18656](https://github.com/nodejs/node/pull/18656)
+* [[`f89f659dcf`](https://github.com/nodejs/node/commit/f89f659dcf)] - **src**: remove unnecessary Reset() calls (Ben Noordhuis) [#18656](https://github.com/nodejs/node/pull/18656)
+* [[`67a9742aed`](https://github.com/nodejs/node/commit/67a9742aed)] - **src**: prevent persistent handle resource leaks (Ben Noordhuis) [#18656](https://github.com/nodejs/node/pull/18656)
+* [[`08bcdde888`](https://github.com/nodejs/node/commit/08bcdde888)] - **(SEMVER-MINOR)** **src**: handle exceptions in env-\>SetImmediates (James M Snell) [#18297](https://github.com/nodejs/node/pull/18297)
+* [[`cc52dae7c4`](https://github.com/nodejs/node/commit/cc52dae7c4)] - **src**: #include \" to iculslocs (Steven R. Loomis) [#19150](https://github.com/nodejs/node/pull/19150)
+* [[`2f17c52674`](https://github.com/nodejs/node/commit/2f17c52674)] - **src**: use std::unique\_ptr for STACK\_OF(X509) (Ben Noordhuis) [#19087](https://github.com/nodejs/node/pull/19087)
+* [[`f10470ce2d`](https://github.com/nodejs/node/commit/f10470ce2d)] - **src**: refactor GetPeerCertificate (Daniel Bevenius) [#19087](https://github.com/nodejs/node/pull/19087)
+* [[`4fae6e3904`](https://github.com/nodejs/node/commit/4fae6e3904)] - **(SEMVER-MINOR)** **src**: make process.dlopen() load well-known symbol (Ben Noordhuis) [#18934](https://github.com/nodejs/node/pull/18934)
+* [[`89edbae7ab`](https://github.com/nodejs/node/commit/89edbae7ab)] - **(SEMVER-MINOR)** **src**: clean up process.dlopen() (Ben Noordhuis) [#18934](https://github.com/nodejs/node/pull/18934)
+* [[`08b83ee27a`](https://github.com/nodejs/node/commit/08b83ee27a)] - **src**: refactor setting JS properties on WriteWrap (Anna Henningsen) [#18963](https://github.com/nodejs/node/pull/18963)
+* [[`4d5cd5c6c5`](https://github.com/nodejs/node/commit/4d5cd5c6c5)] - **src**: fix error message in async\_hooks constructor (Daniel Bevenius) [#19000](https://github.com/nodejs/node/pull/19000)
+* [[`6787913a68`](https://github.com/nodejs/node/commit/6787913a68)] - **test**: add more information to assert.strictEqual (Ujjwal Sharma) [#19162](https://github.com/nodejs/node/pull/19162)
+* [[`ee653ecd09`](https://github.com/nodejs/node/commit/ee653ecd09)] - **test**: move require http2 to after crypto check (Daniel Bevenius) [#19111](https://github.com/nodejs/node/pull/19111)
+* [[`5bbf009c1d`](https://github.com/nodejs/node/commit/5bbf009c1d)] - **test**: check symbols in shared lib (Yihong Wang) [#18806](https://github.com/nodejs/node/pull/18806)
+* [[`d8833762cb`](https://github.com/nodejs/node/commit/d8833762cb)] - **test**: refactor test-async-wrap-getasyncid (Santiago Gimeno) [#18727](https://github.com/nodejs/node/pull/18727)
+* [[`23107ba7b1`](https://github.com/nodejs/node/commit/23107ba7b1)] - **test**: remove assert message and add block scope (wuweiweiwu) [#19054](https://github.com/nodejs/node/pull/19054)
+* [[`cc90bbd0f4`](https://github.com/nodejs/node/commit/cc90bbd0f4)] - **test**: fix flaky inspector-stop-profile-after-done (Rich Trott) [#18126](https://github.com/nodejs/node/pull/18126)
+* [[`8d595bb25c`](https://github.com/nodejs/node/commit/8d595bb25c)] - **test**: check endless loop while writing empty string (XadillaX) [#18924](https://github.com/nodejs/node/pull/18924)
+* [[`a4550069ca`](https://github.com/nodejs/node/commit/a4550069ca)] - **test**: allow running with `NODE\_PENDING\_DEPRECATION` (Anna Henningsen) [#18991](https://github.com/nodejs/node/pull/18991)
+* [[`fd27165f73`](https://github.com/nodejs/node/commit/fd27165f73)] - **test**: specify 'dir' for directory symlinks (Kyle Farnung) [#19049](https://github.com/nodejs/node/pull/19049)
+* [[`eca333a6e8`](https://github.com/nodejs/node/commit/eca333a6e8)] - **test**: refactor test after review (Andrew Johnston) [#18999](https://github.com/nodejs/node/pull/18999)
+* [[`c943cd09a7`](https://github.com/nodejs/node/commit/c943cd09a7)] - **test**: fix repl-tab-complete --without-ssl (Daniel Bevenius) [#17867](https://github.com/nodejs/node/pull/17867)
+* [[`f864509991`](https://github.com/nodejs/node/commit/f864509991)] - **test,benchmark**: use new Buffer API where appropriate (Сковорода Никита Андреевич) [#18980](https://github.com/nodejs/node/pull/18980)
+* [[`479b622e49`](https://github.com/nodejs/node/commit/479b622e49)] - **tls,http2**: handle writes after SSL destroy more gracefully (Anna Henningsen) [#18987](https://github.com/nodejs/node/pull/18987)
+* [[`3d4cda3a7d`](https://github.com/nodejs/node/commit/3d4cda3a7d)] - **(SEMVER-MINOR)** **trace_events**: add file pattern cli option (Andreas Madsen) [#18480](https://github.com/nodejs/node/pull/18480)
+* [[`3e8e1524ac`](https://github.com/nodejs/node/commit/3e8e1524ac)] - **util**: use blue on non-windows systems for number (Gus Caplan) [#18925](https://github.com/nodejs/node/pull/18925)
+
## 2018-03-02, Version 9.7.1 (Current), @rvagg
diff --git a/doc/onboarding-extras.md b/doc/onboarding-extras.md
index fa2d1ae02d9..f07d20e0a86 100644
--- a/doc/onboarding-extras.md
+++ b/doc/onboarding-extras.md
@@ -52,17 +52,17 @@ If you cannot find who to cc for a file, `git shortlog -n -s ` may help.
### By Subsystem
-We generally sort issues by a concept of "subsystem" so that we know what
-part(s) of the codebase it touches.
+Subsystems include:
-**Subsystems generally are**:
+* `lib/*.js` (`assert`, `buffer`, etc.)
+* `build`
+* `doc`
+* `lib / src`
+* `test`
+* `tools`
-* `lib/*.js`
-* `doc`, `build`, `tools`, `test`, `deps`, `lib / src` (special), and there may
- be others.
-* `meta` for anything non-code (process) related
-
-There may be more than one subsystem valid for any particular issue / PR.
+There may be more than one subsystem valid for any particular issue or pull
+request.
### General
@@ -72,6 +72,7 @@ Please use these when possible / appropriate
* `discuss` - Things that need larger discussion
* `feature request` - Any issue that requests a new feature (usually not PRs)
* `good first issue` - Issues suitable for newcomers to process
+* `meta` - For issues whose topic is governance, policies, procedures, etc.
--
diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index 4d5fc7d2ede..5a18e40b4f1 100644
--- a/lib/_http_agent.js
+++ b/lib/_http_agent.js
@@ -26,7 +26,6 @@ const util = require('util');
const EventEmitter = require('events');
const debug = util.debuglog('http');
const { async_id_symbol } = require('internal/async_hooks').symbols;
-const { nextTick } = require('internal/process/next_tick');
// New Agent code.
@@ -342,10 +341,7 @@ Agent.prototype.destroy = function destroy() {
function handleSocketCreation(request, informRequest) {
return function handleSocketCreation_Inner(err, socket) {
if (err) {
- const asyncId = (socket && socket._handle && socket._handle.getAsyncId) ?
- socket._handle.getAsyncId() :
- null;
- nextTick(asyncId, () => request.emit('error', err));
+ process.nextTick(emitErrorNT, request, err);
return;
}
if (informRequest)
@@ -355,6 +351,10 @@ function handleSocketCreation(request, informRequest) {
};
}
+function emitErrorNT(emitter, err) {
+ emitter.emit('error', err);
+}
+
module.exports = {
Agent,
globalAgent: new Agent()
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 3687288ee89..8e3d61a7561 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -36,9 +36,9 @@ const {
const { OutgoingMessage } = require('_http_outgoing');
const Agent = require('_http_agent');
const { Buffer } = require('buffer');
+const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
const { urlToOptions, searchParamsSymbol } = require('internal/url');
const { outHeadersKey, ondrain } = require('internal/http');
-const { nextTick } = require('internal/process/next_tick');
const {
ERR_HTTP_HEADERS_SENT,
ERR_INVALID_ARG_TYPE,
@@ -563,10 +563,10 @@ function responseKeepAlive(res, req) {
socket.once('error', freeSocketErrorListener);
// There are cases where _handle === null. Avoid those. Passing null to
// nextTick() will call getDefaultTriggerAsyncId() to retrieve the id.
- const asyncId = socket._handle ? socket._handle.getAsyncId() : null;
+ const asyncId = socket._handle ? socket._handle.getAsyncId() : undefined;
// Mark this socket as available, AFTER user-added end
// handlers have a chance to run.
- nextTick(asyncId, emitFreeNT, socket);
+ defaultTriggerAsyncIdScope(asyncId, process.nextTick, emitFreeNT, socket);
}
}
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index cd7caae9ae7..1c2250a4b2d 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -31,8 +31,10 @@ const common = require('_http_common');
const checkIsHttpToken = common._checkIsHttpToken;
const checkInvalidHeaderChar = common._checkInvalidHeaderChar;
const { outHeadersKey } = require('internal/http');
-const { async_id_symbol } = require('internal/async_hooks').symbols;
-const { nextTick } = require('internal/process/next_tick');
+const {
+ defaultTriggerAsyncIdScope,
+ symbols: { async_id_symbol }
+} = require('internal/async_hooks');
const {
ERR_HTTP_HEADERS_SENT,
ERR_HTTP_INVALID_HEADER_VALUE,
@@ -272,15 +274,14 @@ function _writeRaw(data, encoding, callback) {
this._flushOutput(conn);
} else if (!data.length) {
if (typeof callback === 'function') {
- let socketAsyncId = this.socket[async_id_symbol];
// If the socket was set directly it won't be correctly initialized
// with an async_id_symbol.
// TODO(AndreasMadsen): @trevnorris suggested some more correct
// solutions in:
// https://github.com/nodejs/node/pull/14389/files#r128522202
- if (socketAsyncId === undefined) socketAsyncId = null;
-
- nextTick(socketAsyncId, callback);
+ defaultTriggerAsyncIdScope(conn[async_id_symbol],
+ process.nextTick,
+ callback);
}
return true;
}
@@ -633,10 +634,13 @@ OutgoingMessage.prototype.write = function write(chunk, encoding, callback) {
function write_(msg, chunk, encoding, callback, fromEnd) {
if (msg.finished) {
const err = new ERR_STREAM_WRITE_AFTER_END();
- nextTick(msg.socket && msg.socket[async_id_symbol],
- writeAfterEndNT.bind(msg),
- err,
- callback);
+ const triggerAsyncId = msg.socket ? msg.socket[async_id_symbol] : undefined;
+ defaultTriggerAsyncIdScope(triggerAsyncId,
+ process.nextTick,
+ writeAfterEndNT,
+ msg,
+ err,
+ callback);
return true;
}
@@ -686,8 +690,8 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
}
-function writeAfterEndNT(err, callback) {
- this.emit('error', err);
+function writeAfterEndNT(msg, err, callback) {
+ msg.emit('error', err);
if (callback) callback(err);
}
diff --git a/lib/dgram.js b/lib/dgram.js
index 78730635cbe..b9caeddabe2 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -44,7 +44,6 @@ const {
symbols: { async_id_symbol }
} = require('internal/async_hooks');
const { UV_UDP_REUSEADDR } = process.binding('constants').os;
-const { nextTick } = require('internal/process/next_tick');
const { UDP, SendWrap } = process.binding('udp_wrap');
@@ -526,7 +525,10 @@ Socket.prototype.close = function(callback) {
this._stopReceiving();
this._handle.close();
this._handle = null;
- nextTick(this[async_id_symbol], socketCloseNT, this);
+ defaultTriggerAsyncIdScope(this[async_id_symbol],
+ process.nextTick,
+ socketCloseNT,
+ this);
return this;
};
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js
index 72d74243d8c..8c4fd08fd83 100644
--- a/lib/internal/async_hooks.js
+++ b/lib/internal/async_hooks.js
@@ -281,6 +281,8 @@ function clearDefaultTriggerAsyncId() {
function defaultTriggerAsyncIdScope(triggerAsyncId, block, ...args) {
+ if (triggerAsyncId === undefined)
+ return Reflect.apply(block, null, args);
// CHECK(Number.isSafeInteger(triggerAsyncId))
// CHECK(triggerAsyncId > 0)
const oldDefaultTriggerAsyncId = async_id_fields[kDefaultTriggerAsyncId];
diff --git a/lib/internal/loader/DefaultResolve.js b/lib/internal/loader/DefaultResolve.js
index c561417bd16..f99e0c98b92 100644
--- a/lib/internal/loader/DefaultResolve.js
+++ b/lib/internal/loader/DefaultResolve.js
@@ -43,7 +43,7 @@ function search(target, base) {
}
const extensionFormatMap = {
- __proto__: null,
+ '__proto__': null,
'.mjs': 'esm',
'.json': 'json',
'.node': 'addon',
diff --git a/lib/internal/process/next_tick.js b/lib/internal/process/next_tick.js
index 39e5a6f8124..7acf266cb7f 100644
--- a/lib/internal/process/next_tick.js
+++ b/lib/internal/process/next_tick.js
@@ -1,8 +1,6 @@
'use strict';
exports.setup = setupNextTick;
-// Will be overwritten when setupNextTick() is called.
-exports.nextTick = null;
function setupNextTick() {
const {
@@ -87,9 +85,6 @@ function setupNextTick() {
// Needs to be accessible from beyond this scope.
process._tickCallback = _tickCallback;
- // Set the nextTick() function for internal usage.
- exports.nextTick = internalNextTick;
-
function _tickCallback() {
let tock;
do {
@@ -165,32 +160,4 @@ function setupNextTick() {
push(new TickObject(callback, args, getDefaultTriggerAsyncId()));
}
-
- // `internalNextTick()` will not enqueue any callback when the process is
- // about to exit since the callback would not have a chance to be executed.
- function internalNextTick(triggerAsyncId, callback) {
- if (typeof callback !== 'function')
- throw new ERR_INVALID_CALLBACK();
- // CHECK(Number.isSafeInteger(triggerAsyncId) || triggerAsyncId === null)
- // CHECK(triggerAsyncId > 0 || triggerAsyncId === null)
-
- if (process._exiting)
- return;
-
- var args;
- switch (arguments.length) {
- case 2: break;
- case 3: args = [arguments[2]]; break;
- case 4: args = [arguments[2], arguments[3]]; break;
- case 5: args = [arguments[2], arguments[3], arguments[4]]; break;
- default:
- args = new Array(arguments.length - 2);
- for (var i = 2; i < arguments.length; i++)
- args[i - 2] = arguments[i];
- }
-
- if (triggerAsyncId === null)
- triggerAsyncId = getDefaultTriggerAsyncId();
- push(new TickObject(callback, args, triggerAsyncId));
- }
}
diff --git a/lib/net.js b/lib/net.js
index 7fa1e20aeda..19f5b135891 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -52,7 +52,6 @@ const {
defaultTriggerAsyncIdScope,
symbols: { async_id_symbol }
} = require('internal/async_hooks');
-const { nextTick } = require('internal/process/next_tick');
const errors = require('internal/errors');
const {
ERR_INVALID_ARG_TYPE,
@@ -392,7 +391,7 @@ function writeAfterFIN(chunk, encoding, cb) {
// TODO: defer error events consistently everywhere, not just the cb
this.emit('error', er);
if (typeof cb === 'function') {
- nextTick(this[async_id_symbol], cb, er);
+ defaultTriggerAsyncIdScope(this[async_id_symbol], process.nextTick, cb, er);
}
}
@@ -1069,7 +1068,7 @@ function lookupAndConnect(self, options) {
// If host is an IP, skip performing a lookup
var addressType = isIP(host);
if (addressType) {
- nextTick(self[async_id_symbol], function() {
+ defaultTriggerAsyncIdScope(self[async_id_symbol], process.nextTick, () => {
if (self.connecting)
defaultTriggerAsyncIdScope(
self[async_id_symbol],
@@ -1372,7 +1371,11 @@ function setupListenHandle(address, port, addressType, backlog, fd) {
var ex = exceptionWithHostPort(err, 'listen', address, port);
this._handle.close();
this._handle = null;
- nextTick(this[async_id_symbol], emitErrorNT, this, ex);
+ defaultTriggerAsyncIdScope(this[async_id_symbol],
+ process.nextTick,
+ emitErrorNT,
+ this,
+ ex);
return;
}
@@ -1383,7 +1386,10 @@ function setupListenHandle(address, port, addressType, backlog, fd) {
if (this._unref)
this.unref();
- nextTick(this[async_id_symbol], emitListeningNT, this);
+ defaultTriggerAsyncIdScope(this[async_id_symbol],
+ process.nextTick,
+ emitListeningNT,
+ this);
}
Server.prototype._listen2 = setupListenHandle; // legacy alias
@@ -1590,8 +1596,11 @@ Server.prototype.getConnections = function(cb) {
const self = this;
function end(err, connections) {
- const asyncId = self._handle ? self[async_id_symbol] : null;
- nextTick(asyncId, cb, err, connections);
+ defaultTriggerAsyncIdScope(self[async_id_symbol],
+ process.nextTick,
+ cb,
+ err,
+ connections);
}
if (!this._usingWorkers) {
@@ -1669,8 +1678,10 @@ Server.prototype._emitCloseIfDrained = function() {
return;
}
- const asyncId = this._handle ? this[async_id_symbol] : null;
- nextTick(asyncId, emitCloseNT, this);
+ defaultTriggerAsyncIdScope(this[async_id_symbol],
+ process.nextTick,
+ emitCloseNT,
+ this);
};
diff --git a/src/async_wrap.cc b/src/async_wrap.cc
index 08bb73f7468..e2656e4eec3 100644
--- a/src/async_wrap.cc
+++ b/src/async_wrap.cc
@@ -415,14 +415,14 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo& info) {
HandleScope scope(info.GetIsolate());
Environment* env = Environment::GetCurrent(info.GetIsolate());
- DestroyParam* p = info.GetParameter();
+ std::unique_ptr p{info.GetParameter()};
Local