Guy Bedford
c537afb18c
module: package "exports" error refinements
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32610
PR-URL: https://github.com/nodejs/node/pull/31625
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-04-03 15:56:41 -04:00
Guy Bedford
05091d48e3
esm: import.meta.resolve with nodejs: builtins
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32610
PR-URL: https://github.com/nodejs/node/pull/31032
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2020-04-03 15:56:32 -04:00
Rich Trott
c0e6e60cb1
tools: update minimist@1.2.5
...
Update minimist used by lint-md.js to 1.2.5.
Refs: https://app.snyk.io/vuln/SNYK-JS-MINIMIST-559764
Signed-off-by: Rich Trott <rtrott@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/32274
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-04-02 00:58:42 -04:00
Christian Clauss
fae680f740
build: drop Travis in favor of Actions
...
GitHub Actions is running all tests already present on Travis, as well
as building on more platforms (OS X and Windows). With Travis we're also
getting timeouts more frequently than with Actions, which gives the
false impression tests are failing (making it harder to triage PRs ready
to merge).
To make our config simpler, CI.yml and pythonpackage.yml got merged. The
coverage is also increased by running tests on OS X.
Signed-off-by: Matheus Marchini <mmarchini@netflix.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/32450
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Christian Clauss <cclauss@me.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2020-04-02 00:49:46 -04:00
Richard Lau
a50648975d
build: annotate markdown lint failures in pull requests
...
Add a problem matcher for output from remark-lint to our lint-md GitHub
Actions CI workflow so that any markdown linter failures are annotated
in the pull request in the web UI.
Signed-off-by: Richard Lau <riclau@uk.ibm.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/32391
Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Matheus Marchini <mat@mmarchini.me >
2020-04-02 00:49:46 -04:00
Richard Lau
c42cb79bb7
build: build docs in GitHub Actions CI workflow
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31504
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-02 00:49:45 -04:00
Richard Lau
46f83df2fd
build: do not use setup-node in build workflows
...
The setup-node GitHub Action installs problem matchers that happen
to match the warning message format of Visual Studio's C/C++ compiler.
This is resulting in all of our pull requests being annotated with
`Unchanged files with check annotations` which are confusing to new
contributors as they are not due to the changes in the pull request.
The action is used to run `npx envinfo` to dump some information into
the logs before the actual build. All GitHub hosted runners already
have a version of Node.js installed (12.x at the time of this commit)
which we can use to run `envinfo`. Remove the action to avoid using
the problematic problem matcher.
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31349
Fixes: https://github.com/nodejs/node/issues/31347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-02 00:49:45 -04:00
扩散性百万甜面包
ad12c82e37
build: fix macos runner type in GitHub Action
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31327
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-02 00:49:45 -04:00
Richard Lau
df701f3b12
build: fix step name in GitHub Actions workflow
...
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31323
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-04-02 00:49:45 -04:00
Richard Lau
d190ee06b4
build: add GitHub actions to run linters
...
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31323
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-04-02 00:49:45 -04:00
gengjiawen
782f5dbddd
src: add build Github Action
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/31153
Reviewed-By: Christian Clauss <cclauss@me.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-04-02 00:49:45 -04:00
ExE Boss
32c0449141
util: use a global symbol for util.promisify.custom
...
Define `util.promisify.custom`
as `Symbol.for("nodejs.util.inspect.custom")`, rather than
as `Symbol("util.inspect.custom")`.
This allows custom `promisify` wrappers to easily/safely be defined
in non‑Node.js environments.
Fixes: https://github.com/nodejs/node/issues/31647
Backport-PR-URL: https://github.com/nodejs/node/pull/32349
PR-URL: https://github.com/nodejs/node/pull/31672
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2020-04-02 00:47:42 -04:00
Anna Henningsen
eee587b847
test: fix test-http2-reset-flood flakiness
...
Refs: https://github.com/nodejs/node/issues/29802#issuecomment-607522598
PR-URL: https://github.com/nodejs/node/pull/32607
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2020-04-02 00:47:08 -04:00
Gerhard Stoebich
a83fc49717
deps: V8: cherry-pick cb1c2b0fbfe7
...
Original commit message:
Remove noscript_shared_function_infos
SharedFunctionInfos that do not belong to a script were tracked in
noscript_shared_function_infos. However this was only used in object-stats.
Remove this since it was actually leaking memory in some use cases.
Bug: v8:9674
Change-Id: I9482f7e5dedf975666a70684b3d2ea04c9a23518
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1798423
Reviewed-by: Ulan Degenbaev <ulan@chromium.org >
Reviewed-by: Michael Stanton <mvstanton@chromium.org >
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org >
Cr-Commit-Position: refs/heads/master@{#63685}
PR-URL: https://github.com/nodejs/node/pull/31939
Refs: https://github.com/v8/v8/commit/cb1c2b0fbfe730ed46d2b7a1ad3f58a21facc477
Refs: https://github.com/nodejs/node/issues/31914
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Matheus Marchini <mat@mmarchini.me >
2020-04-01 23:49:42 -04:00
Matheus Marchini
784df12494
deps: revert whitespace changes on V8
...
While landing some of the V8 upgrades on the v12 branch, something went
wrong and git made unecessary (and incorrect) whitespace changes to test
fixtures, which broke V8 tests. This was likely caused by the use of
`git node land` or a simiar tool. Revert those changes to fix our tests.
Since this only reverts unwanted changes on deps/v8, and it only affects
tests, don't bump v8_embedder_string.
PR-URL: https://github.com/nodejs/node/pull/32605
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
2020-04-01 23:33:40 -04:00
Myles Borins
f58594b8ec
doc: update releaser list in README.md
...
Moved emeritus members keys and fixed alphabetization issues
PR-URL: https://github.com/nodejs/node/pull/32577
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-04-01 19:11:57 -04:00
Robert Nagy
12253f8c74
stream: sync stream unpipe resume
...
pipe() ondata should not control flow state if cleaned up.
Fixes: https://github.com/nodejs/node/issues/31190
Backport-PR-URL: https://github.com/nodejs/node/pull/32264
PR-URL: https://github.com/nodejs/node/pull/31191
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32264
2020-04-01 19:09:37 -04:00
Rod Vagg
885c88ee5b
doc: official macOS builds now on 10.15 + Xcode 11
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/31459
Refs: https://github.com/nodejs/node/issues/29216
Reviewed-By: Christian Clauss <cclauss@me.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Ash Cripps <ashley.cripps@ibm.com >
Signed-off-by: Rod Vagg <rod@vagg.org >
2020-04-01 18:00:04 -04:00
Rod Vagg
7d3910d078
build: macOS package notarization
...
Includes hardened-runtime patch from gdams from
https://github.com/nodejs/node/issues/29216#issuecomment-546932966
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/31459
Refs: https://github.com/nodejs/node/issues/29216
Reviewed-By: Christian Clauss <cclauss@me.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Ash Cripps <ashley.cripps@ibm.com >
Signed-off-by: Rod Vagg <rod@vagg.org >
2020-04-01 18:00:01 -04:00
Ruy Adorno
6db190bb1c
deps: upgrade npm to 6.14.4
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/32495
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2020-04-01 17:59:58 -04:00
Rod Vagg
652ffa5470
deps: update term-size with signed version
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/31459
Refs: https://github.com/nodejs/node/issues/29216
Refs: https://github.com/sindresorhus/macos-term-size/pull/3
Reviewed-By: Christian Clauss <cclauss@me.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Ash Cripps <ashley.cripps@ibm.com >
Signed-off-by: Rod Vagg <rod@vagg.org >
2020-04-01 17:59:56 -04:00
Ben Noordhuis
f55d071bfd
deps: remove *.pyc files from deps/npm
...
These seem to have accidentally slipped into the npm source tarball and
cause problems when contributors update their git checkout of node.
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/32387
Refs: https://github.com/nodejs/node/pull/32368
Refs: https://github.com/npm/cli/issues/1037
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2020-04-01 17:59:53 -04:00
Myles Borins
c419cd21e3
deps: update npm to 6.14.3
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/32368
Refs: https://github.com/nodejs/node/issues/32296
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2020-04-01 17:59:50 -04:00
isaacs
17217a5275
deps: upgrade npm to 6.14.1
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32527
PR-URL: https://github.com/nodejs/node/pull/31977
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2020-04-01 17:59:42 -04:00
Anna Henningsen
fbd5be6734
src: delete BaseObjectWeakPtr data when pointee is gone
...
Fix the condition for deleting the underlying data pointed to by
a `BaseObjectWeakPtr`, which erroneously skipped that deletion
when `ptr->get()` was `nullptr`. This fixes a memory leak reported
by some of the tests.
Refs: https://github.com/nodejs/node/pull/30374#issuecomment-601848973
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/32393
Reviewed-By: Matheus Marchini <mat@mmarchini.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-04-01 17:37:26 -04:00
Anna Henningsen
56a45095b7
src: harden running native SetImmediate()s slightly
...
Prevent mistakes like the one fixed by the previous commit
by destroying the callback immediately after it has been called.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31468
Refs: https://github.com/nodejs/node/pull/31386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2020-04-01 17:37:23 -04:00
Anna Henningsen
c5de212039
worker: move JoinThread() back into exit callback
...
de2c68c7dd moved this call to
the destructor, under the assumption that that would essentially
be equivalent to running it as part of the callback since the
worker would be destroyed along with the callback.
However, the actual code in
`Environment::RunAndClearNativeImmediates()` comes with the subtlety
that testing whether a JS exception has been thrown
happens between the invocation of the callback and its destruction,
leaving a possible exception from `JoinThread()` potentially
unhandled (and unintentionally silenced through the `TryCatch`).
This affected exceptions thrown from the `'exit'` event of the
Worker, and made the `parallel/test-worker-message-type-unknown`
test flaky, as the invalid message was sometimes only received
during the Worker thread’s exit handler.
Fix this by moving the `JoinThread()` call back to where it was
before.
Refs: https://github.com/nodejs/node/pull/31386
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31468
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2020-04-01 17:37:19 -04:00
Anna Henningsen
cb16aabd15
src: simplify native immediate queue running
...
Make `SetImmediate()` behave more like `process.nextTick()`
(which matches how we use it) by also running tasks that have been
added during previous `SetImmediate()` calls.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31502
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2020-04-01 17:37:15 -04:00
Anna Henningsen
87cfbb2da1
report: add support for Workers
...
Include a report for each sub-Worker of the current Node.js instance.
This adds a feature that is necessary for eventually making the report
feature stable, as was discussed during the last collaborator summit.
Refs: https://github.com/openjs-foundation/summit/pull/240
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:37:13 -04:00
Anna Henningsen
c2176e15ea
src: move MemoryInfo() for worker code to .cc files
...
This is a) the right thing to do anyway because these functions
can not be inlined by the compiler and b) avoids compilation warnings
in the following commit.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:37:10 -04:00
Anna Henningsen
22bf867149
src: add interrupts to Environments/Workers
...
Allow doing what V8’s `v8::Isolate::RequestInterrupt()` does for V8.
This also works when there is no JS code currently executing.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:37:07 -04:00
Anna Henningsen
7c2c068aeb
src: remove AsyncRequest
...
Remove `AsyncRequest` from the source code, and replace its
usage with threadsafe `SetImmediate()` calls. This has the
advantage of being able to pass in any function, rather than
one that is defined when the `AsyncRequest` is “installed”.
This necessitates two changes:
- The stopping flag (which was only used in one case and ignored
in the other) is now a direct member of the `Environment` class.
- Workers no longer have their own libuv handles, requiring
manual management of their libuv ref count.
As a drive-by fix, the `can_call_into_js` variable was turned
into an atomic variable. While there have been no bug reports,
the flag is set from `Stop(env)` calls, which are supposed to
be possible from any thread.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:37:04 -04:00
Anna Henningsen
748a530046
src: add a threadsafe variant of SetImmediate()
...
Add a variant of `SetImmediate()` that can be called from any thread.
This allows removing the `AsyncRequest` abstraction and replaces it
with a more generic mechanism.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:37:01 -04:00
Anna Henningsen
aafb224147
src: exclude C++ SetImmediate() from count
...
There is no real reason to manage a count manually, given that
checking whether there are C++ callbacks is a single pointer
comparison.
This makes it easier to add other kinds of native C++ callbacks
that are managed in a similar way.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:36:59 -04:00
Anna Henningsen
5df969826d
src: better encapsulate native immediate list
...
Refactor for clarity and reusability. Make it more obvious that the
list is a FIFO queue.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 17:36:56 -04:00
Anna Henningsen
2625244111
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
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
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 >
2020-04-01 17:36:53 -04:00
Anna Henningsen
5b65348fed
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()`.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
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 >
2020-04-01 17:36:50 -04:00
Anna Henningsen
51230f71ff
src: add more can_call_into_js() guards
...
This is in preparation for running native `SetImmediate()`
callbacks during shutdown.
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
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 >
2020-04-01 17:36:48 -04:00
Anna Henningsen
7647bfe3fc
src: keep object alive in stream_pipe code
...
This was overlooked in a489583eda .
Refs: https://github.com/nodejs/node/pull/30374
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
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 >
2020-04-01 17:36:45 -04:00
Anna Henningsen
5f95e69f4d
src: remove HandleWrap instances from list once closed
...
This allows keeping `BaseObjectPtr`s to `HandleWrap` instances.
Previously, the pointer kept the `HandleWrap` object alive, leaving
the Environment cleanup code that waits for the handle list to drain
in a busy loop, because only the `HandleWrap` destructor removed
the item from the list.
Refs: https://github.com/nodejs/quic/pull/165
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/30374
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/149
Refs: https://github.com/nodejs/quic/pull/141
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-04-01 17:36:42 -04:00
Anna Henningsen
e17d314a21
src: remove keep alive option from SetImmediate()
...
This is no longer necessary now that the copyable `BaseObjectPtr`
is available (as opposed to the only-movable `v8::Global`).
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/30374
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/149
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/165
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-04-01 17:36:39 -04:00
Anna Henningsen
6db84d3e50
src: use BaseObjectPtr for keeping channel alive in dns bindings
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/30374
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/149
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/165
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-04-01 17:36:36 -04:00
Anna Henningsen
4745ac4fd7
http2: use custom BaseObject smart pointers
...
Refs: https://github.com/nodejs/quic/pull/141
Reviewed-By: James M Snell <jasnell@gmail.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/30374
Refs: https://github.com/nodejs/quic/pull/149
Refs: https://github.com/nodejs/quic/pull/165
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-04-01 17:36:32 -04:00
Anna Henningsen
c60780ff52
src: introduce custom smart pointers for BaseObjects
...
Referring to `BaseObject` instances using standard C++ smart pointers
can interfere with BaseObject’s own cleanup mechanisms
(explicit delete, delete-on-GC and delete-on-cleanup).
Introducing custom smart pointers allows referring to `BaseObject`s
safely while keeping those mechanisms intact.
Refs: https://github.com/nodejs/quic/pull/141
Refs: https://github.com/nodejs/quic/pull/149
Reviewed-By: James M Snell <jasnell@gmail.com >
Backport-PR-URL: https://github.com/nodejs/node/pull/32301
PR-URL: https://github.com/nodejs/node/pull/30374
Refs: https://github.com/nodejs/quic/pull/165
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-04-01 17:36:21 -04:00
Ruben Bridgewater
d568efcd22
test: refactor common.expectsError
...
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.
The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.
This has the side effect that `common` is used significantly less
frequent.
Backport-PR-URL: https://github.com/nodejs/node/pull/31449
PR-URL: https://github.com/nodejs/node/pull/31092
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2020-04-01 12:58:33 -04:00
Myles Borins
e4f9360287
test: mark test-http2-reset-flood flaky on bsd
...
This test is somewhat regularly flaky on 12.x and it appears master as
well. There appears to be an issue tracking flakes for 6+ months. Seems
reasonable to mark this to keep us from having red CI.
Refs: https://github.com/nodejs/node/issues/29802
PR-URL: https://github.com/nodejs/node/pull/32595
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-04-01 12:56:29 -04:00
Myles Borins
6f50b60018
test: add test-worker-prof to the SLOW list for debug
...
Consistently failing on ubuntu1804_sharedlibs_debug_x64
Refs: https://github.com/nodejs/node/issues/26401
PR-URL: https://github.com/nodejs/node/pull/32589
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2020-04-01 12:56:20 -04:00
Andrew Neitsch
aec22268af
cli: allow --jitless V8 flag in NODE_OPTIONS
...
This work is modeled on #30094 which allowed
`--disallow-code-generation-from-strings` in `NODE_OPTIONS`.
The `--jitless` v8 option has been supported since 12.0.0. As a v8
option, node automatically picks it up, but there have been a few issues
that were resolved by simply telling users about the option: #26758 ,
This PR:
- allows `--jitless` in `NODE_OPTIONS`
- documents `--jitless`
- moves `--experimental-loader=module` to locally restore alphabetical
order in option documentation
Refs: https://github.com/nodejs/node/pull/30094
Refs: https://github.com/nodejs/node/issues/26758
Refs: https://github.com/nodejs/node/issues/28800
Backport-PR-URL: https://github.com/nodejs/node/pull/32594
PR-URL: https://github.com/nodejs/node/pull/32100
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2020-04-01 12:51:47 -04:00
Geoffrey Booth
4ee41c572c
module: drop support for extensionless main entry points in esm
...
Backport-PR-URL: https://github.com/nodejs/node/pull/32280
PR-URL: https://github.com/nodejs/node/pull/31415
Backport-PR-URL: https://github.com/nodejs/node/pull/32280
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-04-01 02:45:01 -04:00
Albert Wang
dca3d298dd
tools: update icu to 65.1
...
Update the version of the bundled ICU (deps/icu-small) to ICU version
65.2.
Fixes: https://github.com/nodejs/node/issues/30211
Fixes: https://github.com/nodejs/node/issues/29540
Backport-PR-URL: https://github.com/nodejs/node/pull/31433
PR-URL: https://github.com/nodejs/node/pull/30232
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com >
2020-04-01 01:54:31 -04:00