Michaël Zasso
a4dfe3b7dc
lib: flatten access to primordials
...
Store all primordials as properties of the primordials object.
Static functions are prefixed by the constructor's name and prototype
methods are prefixed by the constructor's name followed by "Prototype".
For example: primordials.Object.keys becomes primordials.ObjectKeys.
Backport-PR-URL: https://github.com/nodejs/node/pull/30731
PR-URL: https://github.com/nodejs/node/pull/30610
Refs: https://github.com/nodejs/node/issues/29766
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-12-01 10:18:56 +01:00
AJ Jordan
cbd50262c0
doc: note that buf.buffer's contents might differ
...
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.
PR-URL: https://github.com/nodejs/node/pull/29651
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 19:37:44 +01:00
Marek Łabuz
5a6f836a15
tools: add unified plugin changing links for html docs
...
This commit introduces additional stage in the process of generating
html docs from markdown files. Plugin transforms links to *.md files
in the respository to links to *.html files in the online documentation.
Fixes: https://github.com/nodejs/node/issues/28689
PR-URL: https://github.com/nodejs/node/pull/29946
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 19:37:44 +01:00
Sam Foxman
a25626c1ed
doc: clarify IncomingMessage.destroy() description
...
State that the 'error' event is emitted on the underlying socket, not
the IncomingMessage object.
PR-URL: https://github.com/nodejs/node/pull/30255
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
2019-11-30 19:37:44 +01:00
garygsc
4800b623ed
test: use arrow functions in addons tests
...
Convert all anonymous callback functions in `test/addons/**/*.js`
to use arrow functions, except for those in
`test/addons/make-callback/test.js` (which reference `this`)
`writing-tests.md` states to use arrow functions when appropriate.
PR-URL: https://github.com/nodejs/node/pull/30131
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2019-11-30 19:37:43 +01:00
Harendra Singh
8fcb450934
doc: fixed a typo in process.md
...
If the process was not spawned with an IPC channel, `process.send`
will be undefined and calling it as `process.send()` would throw error
PR-URL: https://github.com/nodejs/node/pull/30277
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 19:37:43 +01:00
David Carlier
ad9f737e44
doc: documenting a bit more FreeBSD case
...
FreeBSD provides more up to date compilers than
the one provided by the system.
PR-URL: https://github.com/nodejs/node/pull/30325
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 19:37:43 +01:00
legendecas
bfcc9142f3
doc,n-api: mark napi_detach_arraybuffer as experimental
...
As its actual release stage.
PR-URL: https://github.com/nodejs/node/pull/30703
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-11-30 19:37:42 +01:00
Michael Lehenbauer
6f313f9ab0
http2: fix session memory accounting after pausing
...
The ability to pause input processing was added in 8a4a193 but
introduced a session memory accounting mismatch leading to potential
NGHTTP2_ENHANCE_YOUR_CALM errors.
After pausing
(https://github.com/nodejs/node/blob/f36331c1bfa4c4c202346b05dc3bd672f653e4df/src/node_http2.cc#L871 ),
the early return on line 873 skips the
DecrementCurrentSessionMemory(stream_buf_.len) call below (line 878).
When we later finished processing the input chunk
(https://github.com/nodejs/node/blob/f36331c1bfa4c4c202346b05dc3bd672f653e4df/src/node_http2.cc#L1858 ),
we were calling DecrementCurrentSessionMemory(stream_buf_offset_) [line
1875] which was a no-op since we just set stream_buf_offset_ to 0 [line
1873].
The correct amount to decrement by is still stream_buf_.len, since
that's the amount we skipped previously (line 878).
Fixes: https://github.com/nodejs/node/issues/29223
Refs: https://github.com/nodejs/node/commit/164ac5b241b96089e6bad5bb83ea416966b3245f
PR-URL: https://github.com/nodejs/node/pull/30684
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2019-11-30 19:37:42 +01:00
Anna Henningsen
be84ceefb8
src: clean up node_file.h
...
- Move inline functions into an `-inl.h` file
- Move override function definitions into `.cc` files
- Remove `using` statements from header files
- Make data fields of classes private
- Mark classes at the end of hierarchies as `final`
This is also partially being done in an attempt to avoid
a particular internal compiler error, see
https://github.com/nodejs/node/pull/30475#issuecomment-554740850
for details.
PR-URL: https://github.com/nodejs/node/pull/30530
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 13:15:23 +01:00
gengjiawen
bccfd124b0
src: remove unused variable in node_dir.cc
...
PR-URL: https://github.com/nodejs/node/pull/30267
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2019-11-30 13:15:23 +01:00
Jeny
ba0115fe6f
test:refactor createHook test
...
PR-URL: https://github.com/nodejs/node/pull/30568
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2019-11-30 13:15:22 +01:00
Brian White
63eb4fee46
buffer: fix 6-byte writeUIntBE() range check
...
Fixes: https://github.com/nodejs/node/issues/30420
PR-URL: https://github.com/nodejs/node/pull/30459
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 13:15:22 +01:00
Anna Henningsen
f37450f580
dns: use length for building TXT string
...
Rely on the length reported by C-Ares rather than `\0`-termination
for creating the JS string for a dns TXT response.
Fixes: https://github.com/nodejs/node/issues/30688
PR-URL: https://github.com/nodejs/node/pull/30690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:58:30 +01:00
Anna Henningsen
099d3fdf87
test: port worker + buffer test to N-API
...
This ports `test/addons/worker-buffer-callback` to N-API,
with the small exception of using external `ArrayBuffer`s rather
than external Node.js `Buffer`s.
PR-URL: https://github.com/nodejs/node/pull/30551
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2019-11-30 03:58:29 +01:00
Anna Henningsen
be9788bf20
n-api: detach external ArrayBuffers on env exit
...
Make sure that `ArrayBuffer`s created using
`napi_create_external_arraybuffer` are rendered unusable
after its memory has been released.
PR-URL: https://github.com/nodejs/node/pull/30551
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2019-11-30 03:58:29 +01:00
Anna Henningsen
e8af569200
buffer: release buffers with free callbacks on env exit
...
Invoke the free callback for a given `Buffer` if it was created
with one, and mark the underlying `ArrayBuffer` as detached.
This makes sure that the memory is released e.g. when addons inside
Workers create such `Buffer`s.
PR-URL: https://github.com/nodejs/node/pull/30551
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2019-11-30 03:58:29 +01:00
Thomas Watson
40b762177f
doc: add missing 'added' versions to module.builtinModules
...
PR-URL: https://github.com/nodejs/node/pull/30562
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
2019-11-30 03:58:28 +01:00
Daniel Nalborczyk
aca0119089
doc: fix worker.resourceLimits indentation
...
PR-URL: https://github.com/nodejs/node/pull/30663
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-30 03:58:28 +01:00
Daniel Nalborczyk
43e78578a6
doc: fix worker.resourceLimits type
...
PR-URL: https://github.com/nodejs/node/pull/30664
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-30 03:58:28 +01:00
Alex Zherdev
20dbce17d5
doc: avoid proposal syntax in code example
...
PR-URL: https://github.com/nodejs/node/pull/30685
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2019-11-30 03:58:27 +01:00
Anna Henningsen
1e7c567734
doc: address nits for src/README.md
...
Refs: https://github.com/nodejs/node/pull/30552#pullrequestreview-321954717
PR-URL: https://github.com/nodejs/node/pull/30693
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2019-11-30 03:58:27 +01:00
Rich Trott
87136c9bde
doc: revise socket.connect() note
...
Edit note in about `onread` option to `socket.connect()` for clarity.
PR-URL: https://github.com/nodejs/node/pull/30691
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 03:58:00 +01:00
Myles Borins
b470354057
deps: patch V8 to 7.9.317.25
...
Refs: https://github.com/v8/v8/compare/7.9.317.23...7.9.317.25
PR-URL: https://github.com/nodejs/node/pull/30679
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-11-30 03:57:59 +01:00
Tobias Nießen
80ada94cd3
build: use Node.js instead of Node in configure
...
PR-URL: https://github.com/nodejs/node/pull/30642
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2019-11-30 03:57:59 +01:00
Tobias Nießen
4affc30a12
crypto: automatically manage memory for ECDSA_SIG
...
Refs: https://github.com/nodejs/node/pull/29292
PR-URL: https://github.com/nodejs/node/pull/30641
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 03:57:59 +01:00
Anna Henningsen
fc11db18fe
src: inline SetSNICallback
...
Refs: https://github.com/nodejs/node/pull/30548#discussion_r348168855
PR-URL: https://github.com/nodejs/node/pull/30548
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-11-30 03:57:58 +01:00
Anna Henningsen
7bd587ef0c
src: use BaseObjectPtr to store SNI context
...
Rather than relying on a link to the JS object, store a pointer to
the C++ object directly.
PR-URL: https://github.com/nodejs/node/pull/30548
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-11-30 03:57:58 +01:00
Anna Henningsen
0b0f0237c1
tls: add memory tracking support to SSLWrap
...
PR-URL: https://github.com/nodejs/node/pull/30548
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-11-30 03:57:58 +01:00
cjihrig
30a4f68a15
child_process: document kill() return value
...
This commit documents the return value from subprocess.kill().
PR-URL: https://github.com/nodejs/node/pull/30669
Refs: https://github.com/nodejs/node/issues/30668
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:58 +01:00
Anna Henningsen
1d1d136806
http: set socket.server unconditionally
...
This is useful for situations in which the socket was not
created for HTTP, e.g. when using arbitrary `Duplex` streams.
(The added test fails because previously, `socket.server.emit()`
would not work for emitting the `clientError` event, as
`socket.server` was `undefined`.)
PR-URL: https://github.com/nodejs/node/pull/30571
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-11-30 03:57:57 +01:00
Fedor Indutny
d257448bca
deps: update llhttp to 2.0.1
...
Changelog:
* Optional SSE4.2 support (at compile time)
* Lenient mode of operation
PR-URL: https://github.com/nodejs/node/pull/30553
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2019-11-30 03:57:57 +01:00
Michaël Zasso
456d250d2d
deps: V8: backport 93f189f19a03
...
Original commit message:
[ic] Fix non-GlobalIC store to interceptor on the global object
We possibly need to load the global object from the global proxy as the holder
of the named interceptor.
Change-Id: I0f9f2e448630608ae853588f6751b55574a9efd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1930903
Commit-Queue: Igor Sheludko <ishell@chromium.org >
Reviewed-by: Igor Sheludko <ishell@chromium.org >
Cr-Commit-Position: refs/heads/master@{#65119}
Refs: https://github.com/v8/v8/commit/93f189f19a030d5de6c5173711dca120ad76e5cd
Fixes: https://github.com/nodejs/node/issues/30586
PR-URL: https://github.com/nodejs/node/pull/30681
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-11-30 03:57:57 +01:00
Anna Henningsen
83861fb333
test: revert 6d022c13
...
Revert "test: skip test-domain-error-types in debug mode temporariliy"
This reverts commit 6d022c13c5 .
PR-URL: https://github.com/nodejs/node/pull/30708
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2019-11-30 03:57:57 +01:00
Anna Henningsen
aa01ebdbca
deps: V8: cherry-pick ca5b0ec
...
Original commit message:
[heap] Ensure SyntheticModule is initialized before next allocation
Ensure that all fields of `SyntheticModule` are set before creating
the exports hash table for it, because the latter may trigger
garbage collection, leading to crashes.
This has been causing failures in the Node.js CI over the last weeks,
after making the creating of synthetic modules part of Node’s
startup sequence.
(I am generally not very familiar with this part of the V8
code and there might be a better way, or possibly a way to add a
reliable regression test, that I am not aware of.)
Refs: https://github.com/nodejs/node/issues/30498
Refs: https://github.com/nodejs/node/issues/30648
Change-Id: I32da4b7bd888c6ec1421f34f5bd52e7bad154c1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1939752
Commit-Queue: Ulan Degenbaev <ulan@chromium.org >
Reviewed-by: Ulan Degenbaev <ulan@chromium.org >
Cr-Commit-Position: refs/heads/master@{#65247}
Refs: https://github.com/v8/v8/commit/ \
ca5b0ec2722d2af4551c01ca78921fa16a26ae72
Fixes: https://github.com/nodejs/node/issues/30498
Fixes: https://github.com/nodejs/node/issues/30648
PR-URL: https://github.com/nodejs/node/pull/30708
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2019-11-30 03:57:56 +01:00
Rich Trott
a3b758d634
test: move test-https-server-consumed-timeout to parallel
...
Change the test to be robust in slow environments and move to parallel.
The previous version of the test failed for me in parallel with just two
or four simultaneous versions running. This version passes 96
simultaneous versions running, but still fails as designed if the
request writes fail to prevent the request timeout from occurring.
PR-URL: https://github.com/nodejs/node/pull/30677
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:56 +01:00
Rich Trott
00f532f15e
test: remove unnecessary common.platformTimeout() call
...
Applying platformTimeout() to the interval is counterproductive. It
should be applied to the request timeout duration only.
PR-URL: https://github.com/nodejs/node/pull/30677
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:56 +01:00
Rich Trott
ecb902f33c
test: do not skip test-http-server-consumed-timeout
...
test-http-server-consumed-timeout has code to that causes it to be
skipped on busy machines. Instead, use an exponential backoff for the
timeout if the machine is busy.
PR-URL: https://github.com/nodejs/node/pull/30677
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:56 +01:00
Rich Trott
49458deb4f
test: remove unused function argument from http test
...
Remove unused `res` from test-http-server-consumed-timeout.
PR-URL: https://github.com/nodejs/node/pull/30677
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:55 +01:00
Jason Macgowan
89e2c71b27
tls: allow empty subject even with altNames defined
...
Behavior described in https://github.com/nodejs/node/issues/11771
is still true even though the issue is closed.
This PR is to allow DNS and URI names, even when there is not a subject.
Refs: https://github.com/nodejs/node/issues/11771
PR-URL: https://github.com/nodejs/node/pull/22906
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:55 +01:00
Anna Henningsen
6322611077
inspector: properly shut down uv_async_t
...
Closing in the Agent destructor is too late, because that happens
when the Environment is destroyed, not when libuv handles are closed.
This fixes a situation in which the same libuv loop is re-used for
multiple Environment instances sequentially, e.g. in our cctest.
PR-URL: https://github.com/nodejs/node/pull/30612
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2019-11-30 03:57:55 +01:00
Alexandre Ferrando
8ec0d75de7
src: cleanup unused headers
...
Node codebase has evolved a lot in the more than 10 years of its
existence. As more features (and code) have been added, changed,
removed, it's sometimes hard to keep track of what gets used and what
not.
This commits attempts to clean some of those potentially left-over
headers using suggestions from include-what-you-use
Refs: https://github.com/nodejs/node/issues/27531
PR-URL: https://github.com/nodejs/node/pull/30328
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:55 +01:00
Rongjian Zhang
2cf8a7f117
module: fix specifier resolution algorithm
...
Fixes: https://github.com/nodejs/node/issues/30520
PR-URL: https://github.com/nodejs/node/pull/30574
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2019-11-30 03:57:24 +01:00
Anna Henningsen
6c249c0982
src: run native immediates during Environment cleanup
...
This can be necessary, because some parts of the Node.js code base
perform cleanup operations in the Immediate callbacks, e.g. HTTP/2.
This resolves flakiness in an HTTP/2 test that failed when a
`SetImmediate()` callback was not run or destroyed before the
`Environment` destructor started, because that callback held a
strong reference to the `Http2Session` object and the expectation
was that no such objects exist once the `Environment` constructor
starts.
Another, slightly more direct, alternative would have
been to clear the immediate queue rather than to run it. However,
this approach seems to make more sense as code generally assumes
that the `SetImmediate()` callback will always run; For example,
N-API uses an immediate callback to call buffer finalization
callbacks.
Unref’ed immediates are skipped, as the expectation is generally
that they may not run anyway.
Fixes: https://github.com/nodejs/node/issues/30643
PR-URL: https://github.com/nodejs/node/pull/30666
Refs: https://github.com/nodejs/node/pull/30374
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:24 +01:00
Anna Henningsen
bea25016d1
src: no SetImmediate from destructor in stream_pipe code
...
Guard against running `SetImmediate()` from the destructor.
The object will not be alive or usable in the callback,
so it does not make sense to attempt to schedule the
`SetImmediate()`.
PR-URL: https://github.com/nodejs/node/pull/30666
Fixes: https://github.com/nodejs/node/issues/30643
Refs: https://github.com/nodejs/node/pull/30374
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:23 +01:00
Anna Henningsen
94357db815
src: add more can_call_into_js() guards
...
This is in preparation for running native `SetImmediate()`
callbacks during shutdown.
PR-URL: https://github.com/nodejs/node/pull/30666
Fixes: https://github.com/nodejs/node/issues/30643
Refs: https://github.com/nodejs/node/pull/30374
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:23 +01:00
Anna Henningsen
d54432f974
src: keep object alive in stream_pipe code
...
This was overlooked in a489583eda .
Refs: https://github.com/nodejs/node/pull/30374
PR-URL: https://github.com/nodejs/node/pull/30666
Fixes: https://github.com/nodejs/node/issues/30643
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-30 03:57:23 +01:00
cjihrig
9d8d2e1f45
src,doc: fix broken links
...
PR-URL: https://github.com/nodejs/node/pull/30662
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-30 03:57:22 +01:00
Denys Otrishko
8171cef921
n-api: implement napi_is_detached_arraybuffer
...
This implements ArrayBuffer#IsDetachedBuffer operation as per ECMAScript
specification Section 24.1.1.2 https://tc39.es/ecma262/#sec-isdetachedbuffer
Closes: https://github.com/nodejs/node/issues/29955
PR-URL: https://github.com/nodejs/node/pull/30613
Fixes: https://github.com/nodejs/node/issues/29955
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2019-11-30 03:57:22 +01:00
Rich Trott
a2f440d326
test: add logging in case of infinite loop
...
test-inspector-contexts may be entering an infinite loop (or very
long-running loop) in CI, resulting in flakiness. Or maybe not. Add
logging to find out.
PR-URL: https://github.com/nodejs/node/pull/30649
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2019-11-30 03:57:22 +01:00