Commit Graph
12026 Commits
Author SHA1 Message Date
bcb85adee6 policy: canonicalize before resolving specifiers
PR-URL: https://github.com/nodejs/node/pull/37863
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>

Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-09-04 15:14:55 +02:00
Bradley Farias d42bbe48c5 esm: use correct URL for error decoration
PR-URL: https://github.com/nodejs/node/pull/37854
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2021-09-04 15:14:54 +02:00
Don Jayamanne 37b4708b19 repl: fix tla function hoisting
PR-URL: https://github.com/nodejs/node/pull/39745
Fixes: https://github.com/nodejs/node/issues/39744
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-09-04 15:14:54 +02:00
Tobias Nießen 0ff520cf02 policy: fix integrity when DEFAULT_ENCODING is set
PR-URL: https://github.com/nodejs/node/pull/39750
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:53 +02:00
voltrexmaster e660892f1a test: use simplfied validator
The validators test should use the simplified `validateArray()`
validator.

PR-URL: https://github.com/nodejs/node/pull/39753
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-04 15:14:53 +02:00
Himadri Ganguly 779417f97e test: use template to concatenate string
PR-URL: https://github.com/nodejs/node/pull/39621
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:47 +02:00
Michael Dawson 2ca12c83b4 node-api: handle pending exception in cb wrapper
fixes: https://github.com/nodejs/node-addon-api/issues/1025

The functionreference test from the node-api tests
was reporting a failed v8 check when Node.js was compiled
as debug. The failure was because an exception was
pending but the C++ wrappers were returning
a return value that was invalid.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/39476
Fixes: https://github.com/nodejs/node-addon-api/issues/1025
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2021-09-04 15:14:46 +02:00
Luigi Pinca a61076042d test: deflake test-http2-buffersize
This is basically a revert of
https://github.com/nodejs/node/commit/c452632d3421d6baf26a61e14c21c922bd18175e.

The problem with that commit is that the promises returned by
`once(server, 'stream')` are all resolved with the same stream when the
first `'stream'` event is emitted.

Refs: https://github.com/nodejs/node/pull/39525#issuecomment-889080913

PR-URL: https://github.com/nodejs/node/pull/39591
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-09-04 15:14:44 +02:00
Himadri Ganguly 68ef265c39 test: convert anonymous function to arrow function
PR-URL: https://github.com/nodejs/node/pull/39604
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-04 15:14:43 +02:00
Rich Trott 78db43c9e7 test: add test-debugger-breakpoint-exists
This adds test coverage to `unpackError()` in
`lib/internal/debugger/inspect_client.js`. That function previously was
untested.

PR-URL: https://github.com/nodejs/node/pull/39570
Refs: https://github.com/nodejs/node-inspect/issues/101
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-09-04 15:14:43 +02:00
Lew Gordon 2bc301dcff http: decodes url.username and url.password for authorization header
This change properly decodes the url.username and url.password for
the authorization header constructed from the URL object for
http(s) requests.

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

PR-URL: https://github.com/nodejs/node/pull/39310
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:39 +02:00
Anna Henningsen 9264caeafe repl: do not include legacy getter/setter methods in completion
For every object that inherits from `Object.prototype`, the REPL
includes the `Object.prototype` methods in its autocompletion.

This is already a little noisy, but in particular, this also
includes the legacy `__defineGetter__` family of methods;
since those are deprecated and not in practical use anymore,
it helps reduce noise a bit to remove them.

This commit does not remove `__proto__` as it is a little
more popular and, despite its downsides, a slightly more convenient
way to access the prototype of an object in the REPL than
`Object.getPrototypeOf(...)`.

PR-URL: https://github.com/nodejs/node/pull/39576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-04 15:14:38 +02:00
Richard Lau 5696bcf715 test: fix WASI link test
The WASI link test attempts to create a link in the temporary directory
to a file in the fixtures directory and can fail if those directories
are on different devices. Update the test so that both the source and
target of the link reside on the same device.

PR-URL: https://github.com/nodejs/node/pull/39485
Fixes: https://github.com/nodejs/node/issues/39484
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:36 +02:00
Luigi Pinca c1782ea1f5 events: allow the options argument to be null
Make `EventTarget.prototype.addEventListener()` accept `null` as a valid
value for the `options` argument.

PR-URL: https://github.com/nodejs/node/pull/39486
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-09-04 15:14:36 +02:00
Rich Trott 0b564a6d40 test: add test for WebSocket secret verification in debugger
PR-URL: https://github.com/nodejs/node/pull/39357
Refs: https://github.com/nodejs/node-inspect/pull/93
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-04 15:14:30 +02:00
legendecas 4c93968a62 deps: extract gtest source files to deps/googletest
PR-URL: https://github.com/nodejs/node/pull/39386
Refs: https://github.com/nodejs/node/pull/39361
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:29 +02:00
legendecas 1a6bf1c4a3 process: add api to enable source-maps programmatically
Add `process.setSourceMapsEnabled` to enable
source-maps programmatically.

PR-URL: https://github.com/nodejs/node/pull/39085
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 15:14:27 +02:00
Rich Trott 831f266d6f test: put common lint exceptions into config file
For lint exceptions that are universal or near universal for
`test/common`, put the exceptions in a config file rather than disabling
the ESLint rules at the top of each file.

PR-URL: https://github.com/nodejs/node/pull/39358
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-04 15:14:26 +02:00
James M Snell d8066f5325 test: mark test-domain-error-types flaky
Refs: https://github.com/nodejs/node/issues/39368
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39369
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-09-04 15:14:25 +02:00
Rich Trott 49e0883c75 debugger: indicate server is ending
Currently, we say "listening" when we are ending the server. Change it
to "ending".

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

PR-URL: https://github.com/nodejs/node/pull/39334
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yash Ladha <yash@yashladha.in>
2021-09-04 15:14:25 +02:00
Rich Trott c915a1bd04 test: remove eslint-disable comment from fixture file
Fixtures are not linted so eslint-disable comments are unnecessary.

PR-URL: https://github.com/nodejs/node/pull/39320
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-09-04 13:02:34 +02:00
Rich Trott 1eb8307cc5 test: move debugger test case to parallel
Move test case that does not require a predetermined port to parallel.

PR-URL: https://github.com/nodejs/node/pull/39300
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2021-09-04 13:00:51 +02:00
Rich Trott 546202364c test: remove debugger workaround for AIX
Optimistically removing workaround code in the debugger test tool.

PR-URL: https://github.com/nodejs/node/pull/39296
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2021-09-04 13:00:30 +02:00
Rich Trott 72a3419510 debugger: rename inspector-cli test module to debugger
PR-URL: https://github.com/nodejs/node/pull/38530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-04 13:00:07 +02:00
Richard Lau e12164e88d test: fix test-debugger-heap-profiler for workers
Fix `sequential/test-debugger-heap-profiler` so that it can be run
in a worker thread. `process.chdir()` is not allowed in worker threads
but passing a current working directory into a spawned child process
is allowed.

PR-URL: https://github.com/nodejs/node/pull/39687
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 12:56:26 +02:00
Rich Trott b3352cfba4 debugger: prevent simultaneous heap snapshots
Fixes: https://github.com/nodejs/node/issues/39555

PR-URL: https://github.com/nodejs/node/pull/39638
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-04 12:56:14 +02:00
Rich Trott a45bf2f1a0 test: use common.PORT instead of hardcoded port number
PR-URL: https://github.com/nodejs/node/pull/39298
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 12:51:19 +02:00
ejose19 50c5e71e22 repl: correctly hoist top level await declarations
PR-URL: https://github.com/nodejs/node/pull/39265
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 12:49:54 +02:00
Rich Trott 9b737ebd4b test: add test for debugger restart message issue
Running "restart" in the debugger confusingly prints an out-of-date
"Debugger listening on..." message before printing a second updated one.

Refs: https://github.com/nodejs/node/issues/39272

PR-URL: https://github.com/nodejs/node/pull/39273
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 12:46:18 +02:00
Rich Trott 68523894ab test: remove workaround code in debugger test
Remove code that made a check more lenient to account for a known issue
that is no longer reproducible.

Refs: https://github.com/nodejs/node-inspect/issues/35

PR-URL: https://github.com/nodejs/node/pull/39238
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2021-09-04 12:45:20 +02:00
Anna Henningsen 6c87b591d9 readline: allow completer to rewrite existing input
Sometimes, it makes sense for a completer to change the existing
input, e.g. by adjusting the casing (imagine a completer that
corrects `Number.isNan` to `Number.IsNaN`, for example).

This commit allows that in the readline implemention.

PR-URL: https://github.com/nodejs/node/pull/39178
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-09-04 12:40:45 +02:00
ejose19 1e065a0a43 repl: processTopLevelAwait fallback error handling
PR-URL: https://github.com/nodejs/node/pull/39290
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 12:37:50 +02:00
legendecas 9e5edf2158 node-api: cctest on v8impl::Reference
PR-URL: https://github.com/nodejs/node/pull/38970
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
2021-09-04 12:37:05 +02:00
Rich Trott 2cd414147b test: move test-debugger-address to parallel
The test uses `--inspect=0` so it uses an OS-selected port rather than
the default port. This means it can be run in the parallel directory.

PR-URL: https://github.com/nodejs/node/pull/39236
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-04 12:33:59 +02:00
Guy Bedford 99664494ff repl: ensure correct syntax err for await parsing
PR-URL: https://github.com/nodejs/node/pull/39154
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-09-04 12:30:39 +02:00
Antoine du Hamel 761dafafde repl: fix Ctrl+C on top level await
PR-URL: https://github.com/nodejs/node/pull/38656
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-09-04 12:29:48 +02:00
Rich Trott e7761b627f tools: apply consistent comma-dangle lint rule
Use comma-dangle settings from the rest of the code base on tests as
well.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-09-04 12:24:58 +02:00
Rich Trott a2e4020e4b test: prepare for consistent comma-dangle lint rule
Make changes so that tests will pass when the comma-dangle settings
applied to the rest of the code base are also applied to tests.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-09-04 12:24:57 +02:00
Rich Trott 315eba7789 tools: make comma-dangle ESLint rule more stringent …
We've been having a lot of nits lately asking people to add trailing
commas, so it's probably time to incrementally make the comma-dangle
rule more stringent.

PR-URL: https://github.com/nodejs/node/pull/37088
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-04 12:24:57 +02:00
Guy Bedford e73bfed2f4 esm: deprecate legacy main lookup for modules
PR-URL: https://github.com/nodejs/node/pull/36918
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-04 12:24:56 +02:00
bcoe dc855af18e errors: don't throw TypeError on missing export
Logic in module_job.js assumes detailed stack trace from node_errors.cc
which is not populated when --enable-source-maps is set.

Fixes #38790

PR-URL: https://github.com/nodejs/node/pull/39017
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-09-04 11:29:38 +02:00
Rich Trott 62b439e04d test: replace "inspector-cli" with "debugger"
When I moved node-inspect into core, I called a lot of things
`inspector-cli` that really should have been `debugger`. This is the
last of them to be renamed.

PR-URL: https://github.com/nodejs/node/pull/39156
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-09-04 11:29:22 +02:00
Rongjian Zhang f13a302d23 test: improve coverage of stream.Readable
PR-URL: https://github.com/nodejs/node/pull/38702
Refs: https://coverage.nodejs.org/coverage-0996eb71edbd47d9/lib/internal/streams/readable.js.html#L401
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-09-04 11:16:08 +02:00
Nitzan Uziely 526e6c7bde readline: add AbortSignal support to interface
Add abort signal support to Interface

PR-URL: https://github.com/nodejs/node/pull/37932
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-04 11:15:51 +02:00
ExE Boss f3d2e6ac29 test: add tests for bound apply variants of varargs primordials
PR-URL: https://github.com/nodejs/node/pull/37005
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-09-04 11:05:24 +02:00
Mattias Runge-Broberg e6eee08692 readline: add support for the AbortController to the question method
In some cases a question asked needs to be canceled. For instance
it might be desirable to cancel a question when a user presses
ctrl+c and triggers the SIGINT event.
Also an initial empty string was set for this.line since the
cursor methods fail if line is not initialized.
Added custom promisify support to the question method.

PR-URL: https://github.com/nodejs/node/pull/33676
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-09-04 11:05:07 +02:00
Adam Majer f70fd00fb3 test: use localhost test instead of connecting to remote
Fixes: https://github.com/nodejs/node/issues/39008

PR-URL: https://github.com/nodejs/node/pull/39011
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-04 10:50:51 +02:00
Qingyu Deng 8b3feee148 http,https: align server option of https with http
Fixes: https://github.com/nodejs/node/issues/38954

PR-URL: https://github.com/nodejs/node/pull/38992
Refs: https://github.com/nodejs/node/pull/30570
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-09-04 10:49:50 +02:00
Michaël Zasso ee1d13c90d fs: use byteLength to handle ArrayBuffer views
Unlike TypedArray, DataView doesn't have a length property.

PR-URL: https://github.com/nodejs/node/pull/38187
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-09-04 10:28:28 +02:00
James M Snell b38d6b475b fs: fixup negative length in fs.truncate
`fs.ftruncate`, `fsPromises.truncate`, and `fsPromises.ftruncate`
all adjust negative lengths to 0 before invoking the system call.
`fs.truncate()` was the one outlier.

This "fixes" https://github.com/nodejs/node/issues/35632 but in the
opposite direction than discussed in the issue -- specifically by
removing an EINVAL error from one function rather than adding it to
another.

Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: https://github.com/nodejs/node/issues/35632

PR-URL: https://github.com/nodejs/node/pull/37483
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-04 10:23:30 +02:00