Daniel Bevenius
6a7a61be7c
src: mark/pop OpenSSL errors in NewRootCertStore
...
This commit sets the OpenSSL error mark before calling
X509_STORE_load_locations and pops the error mark afterwards.
The motivation for this is that it is possible that
X509_STORE_load_locations can produce errors if the configuration
option --openssl-system-ca-path file does not exist. Later if a
different function is called which calls an OpenSSL function it could
fail because these errors might still be on the OpenSSL error stack.
Currently, all functions that call NewRootCertStore clear the
OpenSSL error queue upon returning, but this was not the case for
example in v12.18.0.
PR-URL: https://github.com/nodejs/node/pull/35514
Fixes: https://github.com/nodejs/node/issues/35456
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-10-21 15:51:34 +01:00
James M Snell
f5acc2d030
crypto: fix regression on randomFillSync
...
Signed-off-by: James M Snell <jasnell@gmail.com >
Fixes: https://github.com/nodejs/node/issues/35722
PR-URL: https://github.com/nodejs/node/pull/35723
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Beth Griggs <bgriggs@redhat.com >
2020-10-21 11:17:58 +01:00
Tobias Nießen
d54edece99
test: refactor test-crypto-pbkdf2
...
PR-URL: https://github.com/nodejs/node/pull/35693
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-21 11:17:58 +01:00
Michaël Zasso
11f1ad939f
module: only try to enrich CJS syntax errors
...
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.
Fixes: https://github.com/nodejs/node/issues/35687
PR-URL: https://github.com/nodejs/node/pull/35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2020-10-19 18:41:10 +00:00
Daijiro Wachi
7afe3af200
url: fix file url reparse
...
Fixes: https://github.com/nodejs/node/issues/35571
Refs: https://github.com/whatwg/url/pull/550
Refs: https://github.com/web-platform-tests/wpt/pull/25989
PR-URL: https://github.com/nodejs/node/pull/35671
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
2020-10-19 15:52:45 +09:00
cjihrig
ca8f3ef2e5
wasi: drop --experimental-wasm-bigint requirement
...
After the V8 8.5 update, the WASI APIs no longer require the
use of --experimental-wasm-bigint. This commit removes its use.
PR-URL: https://github.com/nodejs/node/pull/35415
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2020-10-18 20:17:43 +02:00
Kim-Anh Tran
94dd7b9f94
test: update tests after increasing typed array size to 4GB
...
PR-URL: https://github.com/nodejs/node/pull/35415
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2020-10-18 20:17:40 +02:00
Myles Borins
089d654dd8
test: fix addons/dlopen-ping-pong for npm 7.0.1
...
This partially reverts c87641aa97 as node-gyp no longer
puts shared objects in an inconsistent location.
PR-URL: https://github.com/nodejs/node/pull/35667
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2020-10-18 17:17:42 +00:00
H Adinarayana
9ce5a03148
test: add test for listen callback runtime binding
...
PR-URL: https://github.com/nodejs/node/pull/35657
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2020-10-17 18:40:55 +05:30
himself65
a3731309cc
test: refactor test-https-host-headers
...
Use `common.mustCall` and `util.debuglog`. Remove unnecessary functions
PR-URL: https://github.com/nodejs/node/pull/32805
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-16 23:25:27 +00:00
Antoine du Hamel
aaf225a2a0
module: add setter for module.parent
...
PR-URL: https://github.com/nodejs/node/pull/35522
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2020-10-17 00:49:56 +02:00
Tobias Nießen
30fb4a015d
test: add common.mustSucceed
...
PR-URL: https://github.com/nodejs/node/pull/35086
Reviewed-By: Ruy Adorno <ruyadorno@github.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-17 00:48:26 +02:00
Danny Sonnenschein
6f34498148
net: add support for resolving DNS CAA records
...
This adds support for DNS Certification Authority Authorization
(RFC 8659) to Node.js.
PR-URL: https://github.com/nodejs/node/pull/35466
Fixes: https://github.com/nodejs/node/issues/19239
Refs: https://github.com/nodejs/node/issues/14713
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2020-10-16 10:21:32 +02:00
Daijiro Wachi
c143266b55
test: add a few uncovered url tests from wpt
...
Refs: https://github.com/web-platform-tests/wpt/pull/25987
PR-URL: https://github.com/nodejs/node/pull/35636
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-16 11:43:17 +09:00
Robert Nagy
1d8ecd8cfe
stream: async iterator stop read if destroyed
...
Fixes some compatibility issues where it is expected
that for await stops reading when the stream is
destroyed.
Refs: https://github.com/nodejs/node/pull/34887
PR-URL: https://github.com/nodejs/node/pull/35640
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-15 15:46:40 -04:00
James M Snell
6751b6dc3d
test: check for AbortController existence
...
Running tests comparitively on older versions of Node.js that
do not have AbortController can be a pain. Only add the
AbortController to knownGlobals if it actually exists.
Signed-off-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/35616
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-15 08:40:13 -07:00
Gireesh Punathil
ddff2b2b22
lib: honor setUncaughtExceptionCaptureCallback
...
This api does not alter the behavior of diagnostic
report configured on uncaught exceptions.
This is deemed as a bug. Honor this API.
Refs: https://github.com/nodejs/node/pull/35588
PR-URL: https://github.com/nodejs/node/pull/35595
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2020-10-15 12:53:39 +05:30
Ian Sutherland
2002d90abd
fs: deprecation warning on recursive rmdir
...
This is a follow up to #35494 to add a deprecation warning when
using recursive rmdir. This only warns if you are attempting
to remove a file or a nonexistent path.
PR-URL: https://github.com/nodejs/node/pull/35562
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2020-10-14 18:56:40 -07:00
Anna Henningsen
6265951153
test: add regression test for v8.getHeapSnapshot() crash
...
Fixes: https://github.com/nodejs/node/issues/35559
PR-URL: https://github.com/nodejs/node/pull/35612
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
2020-10-14 20:11:51 +02:00
Anna Henningsen
9fd6122659
src: add embedding helpers to reduce boilerplate code
...
Provide helpers for a) spinning the event loop and
b) setting up and tearing down the objects involved in a single
Node.js instance, as they would typically be used.
The former helper is also usable inside Node.js itself,
for both Worker and main threads.
PR-URL: https://github.com/nodejs/node/pull/35597
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
2020-10-14 20:08:19 +02:00
Myles Borins
d9e98df01b
test: fix tests for npm 7.0.0
...
PR-URL: https://github.com/nodejs/node/pull/35631
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Ruy Adorno <ruyadorno@github.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2020-10-14 10:36:46 -04:00
Rod Vagg
999e7d7b44
gyp,build: consistent shared library location
...
Ref: https://github.com/nodejs/node-gyp/issues/2233
Ref: https://github.com/nodejs/gyp-next/pull/69
PR-URL: https://github.com/nodejs/node/pull/35635
Refs: https://github.com/nodejs/gyp-next/releases/tag/v0.6.0
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
2020-10-14 12:09:57 +05:30
bcoe
7d6672226b
fs: rimraf should not recurse on failure
...
PR-URL: https://github.com/nodejs/node/pull/35566
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-13 15:04:57 -07:00
James M Snell
efe60a5fe2
test: mark test-webcrypto-encrypt-decrypt-aes flaky
...
Appears to be flaky only on rhe17-390x. Will be investigating
refs: https://github.com/nodejs/node/issues/35586
PR-URL: https://github.com/nodejs/node/pull/35587
Refs: https://github.com/nodejs/node/issues/35586
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2020-10-13 17:03:06 +00:00
James M Snell
095be6a01f
crypto: add getCipherInfo method
...
Simple method for retrieving basic information about a cipher
(such as block length, expected or default iv length, key length,
etc)
Signed-off-by: James M Snell <jasnell@gmail.com >
Fixes: https://github.com/nodejs/node/issues/22304
PR-URL: https://github.com/nodejs/node/pull/35368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2020-10-13 09:30:53 -07:00
Daniil Demidovich
ce4ac15850
lib: fix readFile flag option typo
...
PR-URL: https://github.com/nodejs/node/pull/35292
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Masashi Hirano <shisama07@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Zeyu Yang <himself65@outlook.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
2020-10-13 16:54:29 +02:00
Daijiro Wachi
9f2e19fa30
test: update url test for win
...
PR-URL: https://github.com/nodejs/node/pull/35622
Fixes: https://github.com/nodejs/node/issues/35621
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2020-10-13 13:23:25 +00:00
Dmitry Gozman
87da7a6d15
inspector: do not hardcode Debugger.CallFrameId in tests
...
Debugger.CallFrameId is defined as an opaque string [1].
Some tests currently hardcode the value, relying on
undocumented internal details of V8. This makes it hard
for V8 to change the internal representation.
We should instead use the reported call frame id from
the Debugger.paused event directly. This is how every
inspector client does it.
[1] https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#type-CallFrameId
PR-URL: https://github.com/nodejs/node/pull/35570
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-13 00:30:24 +00:00
Luigi Pinca
c739f371c3
test: do not use the same EventEmitter instance
...
Prevent multiple listeners for the `'error'` event to be added to the
same `EventEmitter` instance.
PR-URL: https://github.com/nodejs/node/pull/35560
Refs: https://github.com/nodejs/node/pull/35557#issuecomment-705476640
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-12 19:07:15 +02:00
Daijiro Wachi
bb62f4ad9e
url: file URL path normalization
...
Refs: https://github.com/whatwg/url/pull/544
Refs: https://github.com/web-platform-tests/wpt/pull/25716
PR-URL: https://github.com/nodejs/node/pull/35477
Fixes: https://github.com/nodejs/node/issues/35429
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2020-10-12 15:06:55 +09:00
Guy Bedford
f3ce2811dd
module: use Wasm CJS lexer when available
...
PR-URL: https://github.com/nodejs/node/pull/35583
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
2020-10-12 04:24:41 -07:00
cjihrig
4cfa5dfccd
fs: update rm/rmdir validation messages
...
The validation code for the rm/rmdir functions treated the
options as distinct parameters instead of the options properties
that they are. This commit updates the validation to treat them
like properties.
PR-URL: https://github.com/nodejs/node/pull/35565
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Masashi Hirano <shisama07@gmail.com >
2020-10-11 16:53:07 +00:00
Anna Henningsen
eee522ac29
lib: add EventTarget-related browser globals
...
Add
- Event
- EventTarget
- MessagePort
- MessageChannel
- MessageEvent
to the set of global objects, since they are available now and behave
like they do in the browser.
Fixes: https://github.com/nodejs/node/issues/35495
PR-URL: https://github.com/nodejs/node/pull/35496
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
2020-10-11 14:35:17 +00:00
Anna Henningsen
705d888387
worker: make MessageEvent class more Web-compatible
...
PR-URL: https://github.com/nodejs/node/pull/35496
Fixes: https://github.com/nodejs/node/issues/35495
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
2020-10-11 14:35:16 +00:00
Anna Henningsen
278d38f4cf
src: add maybe versions of EmitExit and EmitBeforeExit
...
This addresses a TODO comment, and removes invalid `.ToLocalChecked()`
calls from our code base.
PR-URL: https://github.com/nodejs/node/pull/35486
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-11 02:20:53 +02:00
Robert Nagy
d70c0ed250
http: allow passing array of key/val into writeHead
...
Enables an optimization when the user already has the headers
in an array form, e.g. when proxying.
PR-URL: https://github.com/nodejs/node/pull/35274
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-10 10:11:41 +02:00
davkor
de7a1abfc2
build: fuzzer that targets node::LoadEnvironment()
...
Refs: https://github.com/nodejs/node/pull/34761
Refs: https://github.com/nodejs/node/issues/33724
PR-URL: https://github.com/nodejs/node/pull/34844
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2020-10-09 12:37:26 -04:00
Luigi Pinca
b474901438
test: add ALPNProtocols option to clientOptions
...
Without this, the session is destroyed with the following error
```
Error [ERR_HTTP2_ERROR]: Protocol error
at Http2Session.onSessionInternalError (internal/http2/core.js:756:26)
Emitted 'error' event on ClientHttp2Session instance at:
at emitClose (internal/http2/core.js:1010:10)
at internal/http2/core.js:1048:7
at finish (internal/streams/writable.js:731:5)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ERR_HTTP2_ERROR',
errno: -505
}
```
The test then calls `session.close()` which tries to write to a
destroyed socket. As a result, an unhandled `ECONNRESET` error is
emitted in the v12 release line.
PR-URL: https://github.com/nodejs/node/pull/35482
Refs: https://github.com/nodejs/node/pull/34859
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-09 16:28:01 +02:00
Ian Sutherland
4e9f3cc6fe
fs: add rm method
...
This PR introduces a new method fs.rm that provides the behaviour of
rimraf when used with the recursive: true and force: true options.
PR-URL: https://github.com/nodejs/node/pull/35494
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ruy Adorno <ruyadorno@github.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2020-10-08 13:23:44 -07:00
James M Snell
dae283d96f
crypto: refactoring internals, add WebCrypto
...
Fixes: https://github.com/nodejs/node/issues/678
Refs: https://github.com/nodejs/node/issues/26854
Signed-off-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/35093
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-07 17:27:05 -07:00
Ben Noordhuis
7b26322f6d
http: make response.setTimeout() work
...
Fixes: https://github.com/nodejs/node/issues/33734
PR-URL: https://github.com/nodejs/node/pull/34913
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2020-10-07 13:50:22 -05:00
Michaël Zasso
21782277c2
src: use node:moduleName as builtin module filename
...
This change allows for easier recognition of builtin modules in stack
traces.
Refs: https://github.com/nodejs/node/issues/11893
PR-URL: https://github.com/nodejs/node/pull/35498
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Zeyu Yang <himself65@outlook.com >
2020-10-07 17:35:14 +02:00
Shelley Vohr
19f14517c7
n-api: support for object freeze/seal
...
PR-URL: https://github.com/nodejs/node/pull/35359
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2020-10-07 08:31:43 -07:00
Myles Borins
c87641aa97
test: fix test suite to work with npm 7
...
PR-URL: https://github.com/nodejs/node/pull/35474
Reviewed-By: Ruy Adorno <ruyadorno@github.com >
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org >
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2020-10-07 09:59:51 -04:00
Rich Trott
27c77b9350
tools,test: enable multiline-comment-style rule in tests
...
Use `//` for multline comments.
PR-URL: https://github.com/nodejs/node/pull/35485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-07 04:36:10 -07:00
Rich Trott
f593f9e9ef
test: adjust comments for upcoming lint rule
...
Enforce `//` for multiline comments. Some tests mixed and matched, and
at least one did so in a (to me) surprising way.
PR-URL: https://github.com/nodejs/node/pull/35485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-10-07 04:36:02 -07:00
Anna Henningsen
40364b181d
src: add check against non-weak BaseObjects at process exit
...
When a process exits cleanly, i.e. because the event loop ends up
without things to wait for, the Node.js objects that are left on
the heap should be:
1. weak, i.e. ready for garbage collection once no longer
referenced, or
2. detached, i.e. scheduled for destruction once no longer
referenced, or
3. an unrefed libuv handle, i.e. does not keep the event loop
alive, or
4. an inactive libuv handle (essentially the same here)
There are a few exceptions to this rule, but generally,
if there are C++-backed Node.js objects on the heap
that do not fall into the above categories, we may be looking
at a potential memory leak. Most likely, the cause is a missing
`MakeWeak()` call on the corresponding object.
In order to avoid this kind of problem, we check the list
of BaseObjects for these criteria. In this commit, we only do so
when explicitly instructed to or when in debug mode
(where --verify-base-objects is always-on).
In particular, this avoids the kinds of memory leak issues
that were fixed in the PRs referenced below.
Refs: https://github.com/nodejs/node/pull/35488
Refs: https://github.com/nodejs/node/pull/35487
Refs: https://github.com/nodejs/node/pull/35481
PR-URL: https://github.com/nodejs/node/pull/35490
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2020-10-07 10:54:34 +02:00
Juan José Arboleda
fb2f3cc828
test: improve test coverage for eventtarget
...
PR-URL: https://github.com/nodejs/node/pull/33733
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2020-10-06 05:39:02 -05:00
Guy Bedford
5e605c0dd9
module: fix builtin reexport tracing
...
PR-URL: https://github.com/nodejs/node/pull/35500
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2020-10-04 10:30:13 -07:00
Anna Henningsen
fdf0a84e82
src: move all base64.h inline methods into -inl.h header file
...
Refs: https://github.com/nodejs/node/pull/34944#discussion_r480321239
PR-URL: https://github.com/nodejs/node/pull/35432
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-10-03 15:41:30 +00:00