Antoine du Hamel
ed8ae88f30
lib: remove unnecessary lazy loading in internal/encoding
...
PR-URL: https://github.com/nodejs/node/pull/45810
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-13 09:42:46 +00:00
Antoine du Hamel
b5b56b6b45
crypto: simplify lazy loading of internal modules
...
The internal `require()` is actually just one map load (to see if the
module is already loaded) + one property load (state check for circular
dependencies) for modules that are already loaded.
Refs: https://github.com/nodejs/node/pull/45659#discussion_r1033762328
PR-URL: https://github.com/nodejs/node/pull/45809
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-12-13 09:42:46 +00:00
Antoine du Hamel
49840d443c
buffer: remove unnecessary lazy loading
...
PR-URL: https://github.com/nodejs/node/pull/45807
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-12-13 09:42:46 +00:00
Yagiz Nizipli
349b4f8817
src: add internal isArrayBufferDetached
...
PR-URL: https://github.com/nodejs/node/pull/45568
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
2022-12-13 09:42:46 +00:00
Daeyeon Jeong
2fbe2f9f0a
src,lib: group properties used as constants from util binding
...
Properties used as constants in `util` internal binding are
scattered. This suggests using an object holding all of them
for better maintenance.
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/45539
Backport-PR-URL: https://github.com/nodejs/node/pull/45674
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2022-12-13 09:42:46 +00:00
Joyee Cheung
470384e7be
util: use private symbols in JS land directly
...
Instead of calling into C++ to use the private symbols, use an
ObjectTemplate to create an object that holds the symbols and
use them directly from JS land.
PR-URL: https://github.com/nodejs/node/pull/45379
Backport-PR-URL: https://github.com/nodejs/node/pull/45674
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
2022-12-13 09:42:45 +00:00
Antoine du Hamel
424419c2b4
test_runner: refactor tap_lexer to use more primordials
...
PR-URL: https://github.com/nodejs/node/pull/45744
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2022-12-13 09:42:45 +00:00
Antoine du Hamel
ffc0f3d7be
test_runner: refactor tap_parser to use more primordials
...
PR-URL: https://github.com/nodejs/node/pull/45745
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-13 09:42:45 +00:00
Debadree Chatterjee
cee6f382d8
watch: add CLI flag to preserve output
...
Fixes: https://github.com/nodejs/node/issues/45713
PR-URL: https://github.com/nodejs/node/pull/45717
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-12-13 09:42:45 +00:00
Pulkit Gupta
5c4475dab9
test: fix invalid output TAP if there newline in test name
...
PR-URL: https://github.com/nodejs/node/pull/45742
Fixes: https://github.com/nodejs/node/issues/45396
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2022-12-13 09:42:45 +00:00
cjihrig
4165dcddf0
test_runner: add t.after() hook
...
This commit adds an after() hook to the TestContext class. This
hook can be used to clean up after a test finishes.
PR-URL: https://github.com/nodejs/node/pull/45792
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-12-13 09:42:44 +00:00
cjihrig
d1bd7796ad
test_runner: don't use a symbol for runHook()
...
This is not exposed to userland, so there is no need to put it
behind a symbol.
PR-URL: https://github.com/nodejs/node/pull/45792
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-12-13 09:42:44 +00:00
Debadree Chatterjee
302c5240c5
lib: allow Writeable.toWeb() to work on http.Outgoing message
...
Attempted to fix the issue by watering down the condition being
checked in internal/streams/utils isWritableNodeStream utility
Fixes: https://github.com/nodejs/node/issues/44188
PR-URL: https://github.com/nodejs/node/pull/45642
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-13 09:42:44 +00:00
Antoine du Hamel
6962ef0df1
readline: improve robustness against prototype mutation
...
PR-URL: https://github.com/nodejs/node/pull/45614
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-12-13 09:42:43 +00:00
Joyee Cheung
e2caf7ced9
bootstrap: lazy load non-essential modules
...
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.
Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).
PR-URL: https://github.com/nodejs/node/pull/45659
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Tierney Cyren <hello@bnb.im >
2022-12-13 09:42:43 +00:00
Deokjin Kim
e8745083b9
lib: check number of arguments in EventTarget's function
...
For now, addEventListener() only checks number of arguments.
removeEventListener() and dispatchEvent() also need checking
number of arguments.
PR-URL: https://github.com/nodejs/node/pull/45668
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
2022-12-13 09:42:43 +00:00
Daeyeon Jeong
9f7bb5ce0e
lib: disambiguate native module to binding
...
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/45673
Refs: https://github.com/nodejs/node/pull/44135
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2022-12-13 09:42:42 +00:00
Daeyeon Jeong
353339a552
lib: disambiguate native module to builtin module
...
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/45673
Refs: https://github.com/nodejs/node/pull/44135
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2022-12-13 09:42:42 +00:00
MURAKAMI Masahiko
6bc7b7e6f4
test_runner: add resetCalls to MockFunctionContext
...
This commit allows tests in test runner to reset
the calls of mock function
Refs: https://github.com/nodejs/node/pull/45326#discussion_r1014728750
PR-URL: https://github.com/nodejs/node/pull/45710
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-13 09:42:42 +00:00
Paolo Insogna
b8b13dccd9
net: add autoSelectFamily and autoSelectFamilyAttemptTimeout options
...
PR-URL: https://github.com/nodejs/node/pull/44731
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-12 16:17:49 +00:00
Debadree Chatterjee
99410efd19
lib: added SuiteContext class
...
added SuiteContext class to replace object literal
Fixes: https://github.com/nodejs/node/issues/45641
Refs: https://github.com/nodejs/node/issues/45641#issuecomment-1329130581
PR-URL: https://github.com/nodejs/node/pull/45687
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2022-12-12 16:17:47 +00:00
Colin Ihrig
3e485365ec
test_runner: don't parse TAP from stderr
...
This commit stops the test runner CLI from parsing child
process stderr as TAP. Per the TAP spec, TAP can only come from
stdout. To avoid losing stderr data, those logs are injected
into the parser as unknown tokens so that they are output as
comments.
PR-URL: https://github.com/nodejs/node/pull/45618
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-12-12 16:17:47 +00:00
MURAKAMI Masahiko
efc44567c9
test_runner: add getter and setter to MockTracker
...
This commit allows tests in test runner to use the
`getter` and `setter` methods as "syntax sugar" for
`MockTracker.method` with the `options.getter` or
`options.setter` set to true in the options.
Refs: https://github.com/nodejs/node/pull/45326#discussion_r1014727289
PR-URL: https://github.com/nodejs/node/pull/45506
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-12-12 16:17:11 +00:00
Moshe Atlow
e4316124fa
fs: fix nonNativeWatcher watching folder with existing files
...
PR-URL: https://github.com/nodejs/node/pull/45500
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-12 16:17:11 +00:00
Antoine du Hamel
573eab9235
crypto: refactor ArrayBuffer to bigint conversion utils
...
PR-URL: https://github.com/nodejs/node/pull/45567
Refs: https://github.com/nodejs/performance/issues/16
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-12-12 16:17:11 +00:00
Moshe Atlow
d272faa54d
fs: fix nonNativeWatcher leak of StatWatchers
...
PR-URL: https://github.com/nodejs/node/pull/45501
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-12-12 16:17:10 +00:00
Yagiz Nizipli
56eee72abb
stream: use structuredClone instead of v8
...
PR-URL: https://github.com/nodejs/node/pull/45611
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-12-12 16:17:10 +00:00
Filip Skokan
845f805490
crypto: refactor verify acceptable key usage functions
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:03 +00:00
Filip Skokan
7cc9998737
crypto: fix ECDH webcrypto public CryptoKey usages
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:03 +00:00
Filip Skokan
d030963f37
crypto: validate CFRG webcrypto JWK import "d" and "x" are a pair
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:03 +00:00
Filip Skokan
9cd106efdc
crypto: use DataError for CFRG webcrypto raw and jwk import key checks
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:03 +00:00
Filip Skokan
9e2e3de6ce
crypto: use DataError for webcrypto keyData import failures
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:03 +00:00
Filip Skokan
40037b4e79
crypto: fix X25519 and X448 webcrypto public CryptoKey usages
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:02 +00:00
Filip Skokan
de2b6b97b9
crypto: ensure "x" is present when importing private CFRG webcrypto keys
...
PR-URL: https://github.com/nodejs/node/pull/45569
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-12-12 16:16:02 +00:00
Kohei Ueno
7892e23e68
repl: do not define wasi on global with no flag
...
PR-URL: https://github.com/nodejs/node/pull/45595
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-12-12 16:16:02 +00:00
Colin Ihrig
c9cbd1d396
test_runner: remove stdout and stderr from error
...
The CLI test runner parses the TAP output from child processes
now and displays it. This commit removes a previous workaround
for displaying child process stdout and stderr when tests
failures occurred.
PR-URL: https://github.com/nodejs/node/pull/45592
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-12-12 16:15:58 +00:00
Wassim Chegham
016749ba5d
test_runner: add initial TAP parser
...
Work in progress
PR-URL: https://github.com/nodejs/node/pull/43525
Refs: https://github.com/nodejs/node/issues/43344
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-11-24 11:46:23 -05:00
Yagiz Nizipli
f720c5880e
stream: use ArrayBufferPrototypeGetByteLength
...
PR-URL: https://github.com/nodejs/node/pull/45528
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-11-24 11:46:22 -05:00
Yagiz Nizipli
4c9159a830
lib: improve transferable abort controller exec
...
PR-URL: https://github.com/nodejs/node/pull/45525
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-24 11:46:22 -05:00
Yagiz Nizipli
5745bcbb41
lib: improve AbortController creation duration
...
PR-URL: https://github.com/nodejs/node/pull/45525
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-24 11:46:22 -05:00
Yagiz Nizipli
c00258e24b
stream: add primordials to adapters
...
PR-URL: https://github.com/nodejs/node/pull/45511
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2022-11-21 15:20:47 -05:00
Robert Nagy
5274a8f7db
stream: avoid premature close when will not emit close
...
Fixes: https://github.com/nodejs/node/issues/45281
PR-URL: https://github.com/nodejs/node/pull/45301
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-11-21 15:20:46 -05:00
MURAKAMI Masahiko
6fdd202c57
module: require.resolve.paths returns null with node schema
...
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.
Fixes: https://github.com/nodejs/node/issues/45001
PR-URL: https://github.com/nodejs/node/pull/45147
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2022-11-21 15:20:46 -05:00
Kohei Ueno
496912d722
stream: fix typo in adapters.js ( #45515 )
...
`isReadableNodestream` -> `isReadableNodeStream`
PR-URL: https://github.com/nodejs/node/pull/45515
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-21 15:20:45 -05:00
Yagiz Nizipli
8d96e2c723
stream: add fast path for utf8
...
PR-URL: https://github.com/nodejs/node/pull/45483
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
2022-11-21 15:20:41 -05:00
Nathanael Ruf
2b760c339e
fs: fix fs.rm support for loop symlinks
...
Fixes: https://github.com/nodejs/node/issues/45404
PR-URL: https://github.com/nodejs/node/pull/45439
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-11-21 15:20:41 -05:00
Antoine du Hamel
38767b42fb
lib: do not throw if global property is no longer configurable
...
Fixes: https://github.com/nodejs/node/issues/45336
PR-URL: https://github.com/nodejs/node/pull/45344
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-11-21 15:20:40 -05:00
Yagiz Nizipli
bbba42fcb2
url: remove unnecessary object call to kFormat
...
PR-URL: https://github.com/nodejs/node/pull/45492
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2022-11-21 15:16:25 -05:00
Moshe Atlow
e9760b4ae8
test_runner: support watch mode
...
PR-URL: https://github.com/nodejs/node/pull/45214
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-21 15:16:23 -05:00
Moshe Atlow
3263ceb21a
watch: watch for missing dependencies
...
PR-URL: https://github.com/nodejs/node/pull/45348
Reviewed-By: Ruy Adorno <ruyadorno@google.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com >
2022-11-21 15:16:22 -05:00