Filip Skokan
c6c4cdab36
crypto: fix webcrypto deriveBits validations
...
PR-URL: https://github.com/nodejs/node/pull/44173
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-08-12 21:31:14 +02:00
Filip Skokan
4b7761441e
crypto: fix webcrypto EC key namedCurve validation errors
...
PR-URL: https://github.com/nodejs/node/pull/44172
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-08-12 21:30:41 +02:00
Filip Skokan
54ca9c9bfc
crypto: fix webcrypto generateKey() AES key length validation error
...
PR-URL: https://github.com/nodejs/node/pull/44170
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-08-12 21:30:09 +02:00
Filip Skokan
ac1b90eed1
crypto: fix webcrypto operation errors to be OperationError
...
PR-URL: https://github.com/nodejs/node/pull/44171
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-08-12 19:29:14 +00:00
Moshe Atlow
74c2c8e080
assert: add getCalls and reset to callTracker
...
PR-URL: https://github.com/nodejs/node/pull/44191
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-08-11 19:27:34 +00:00
Moshe Atlow
8f9d1ab5ec
assert: add assert.Snapshot
...
PR-URL: https://github.com/nodejs/node/pull/44095
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-08-11 13:07:52 +00:00
theanarkh
818bd6cb4d
net: remove unused callback
...
PR-URL: https://github.com/nodejs/node/pull/44204
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-08-11 09:33:14 +00:00
Basit Chonka
9b8ba25360
events: use bitset to save memory
...
PR-URL: https://github.com/nodejs/node/pull/43700
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-08-10 13:01:10 +02:00
Nick Sia
b4279240f5
http: fix error message when specifying headerTimeout for createServer
...
This change fixes the message on the error received when calling
http.createServer(...) with a header timeout greater than the request
timeout is incorrect.
The validation requires that the header timeout is lower than the
request timeout, but the error message asks for the opposite.
PR-URL: https://github.com/nodejs/node/pull/44163
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
2022-08-09 09:27:18 +00:00
Joyee Cheung
472edc775d
src: disambiguate terms used to refer to builtins and addons
...
The term "native module" dates back to some of the oldest code
in the code base. Within the context of Node.js core it usually
refers to modules that are native to Node.js (e.g. fs, http),
but it can cause confusion for people who don't work on this
part of the code base, as "native module" can also refer to
native addons - which is even the case in some of the API
docs and error messages.
This patch tries to make the usage of these terms more consistent.
Now within the context of Node.js core:
- JavaScript scripts that are built-in to Node.js are now referred
to as "built-in(s)". If they are available as modules,
they can also be referred to as "built-in module(s)".
- Dynamically-linked shared objects that are loaded into
the Node.js processes are referred to as "addons".
We will try to avoid using the term "native modules" because it could
be ambiguous.
Changes in this patch:
File names:
- node_native_module.h -> node_builtins.h,
- node_native_module.cc -> node_builtins.cc
C++ binding names:
- `native_module` -> `builtins`
`node::Environment`:
- `native_modules_without_cache` -> `builtins_without_cache`
- `native_modules_with_cache` -> `builtins_with_cache`
- `native_modules_in_snapshot` -> `builtins_in_cache`
- `native_module_require` -> `builtin_module_require`
`node::EnvSerializeInfo`:
- `native_modules` -> `builtins
`node::native_module::NativeModuleLoader`:
- `native_module` namespace -> `builtins` namespace
- `NativeModuleLoader` -> `BuiltinLoader`
- `NativeModuleRecordMap` -> `BuiltinSourceMap`
- `NativeModuleCacheMap` -> `BuiltinCodeCacheMap`
- `ModuleIds` -> `BuiltinIds`
- `ModuleCategories` -> `BuiltinCategories`
- `LoadBuiltinModuleSource` -> `LoadBuiltinSource`
`loader.js`:
- `NativeModule` -> `BuiltinModule` (the `NativeModule` name used in
`process.moduleLoadList` is kept for compatibility)
And other clarifications in the documentation and comments.
PR-URL: https://github.com/nodejs/node/pull/44135
Fixes: https://github.com/nodejs/node/issues/44036
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2022-08-09 01:36:49 +08:00
Antoine du Hamel
6f9eff880b
esm: do not bind loader hook functions
...
PR-URL: https://github.com/nodejs/node/pull/44122
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-08-08 08:51:35 +00:00
legendecas
0a2c910ae9
src,lib: print prinstine source when source map source not found
...
Print unmapped source lines when the source map source is not
found. Error stacks should be correctly mapped even when the
source is absent.
PR-URL: https://github.com/nodejs/node/pull/44052
Refs: https://github.com/nodejs/node/pull/44019
Reviewed-By: Ben Coe <bencoe@gmail.com >
2022-08-06 19:56:27 +08:00
theanarkh
4c5b96b376
http: trace http request / response
...
PR-URL: https://github.com/nodejs/node/pull/44102
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2022-08-05 14:25:06 +00:00
Antoine du Hamel
464d1c1558
lib: reset RegExp statics before running user code
...
Fixes: https://github.com/nodejs/node/issues/43740
PR-URL: https://github.com/nodejs/node/pull/43741
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-08-05 10:01:32 +02:00
alexcfyung
02aa8c22c2
lib: pass env variables to child process on z/OS
...
PR-URL: https://github.com/nodejs/node/pull/42255
Reviewed-By: Michael Dawson <midawson@redhat.com >
2022-08-04 18:52:43 -04:00
Antoine du Hamel
9cecba0f1c
module: protect against prototype mutation
...
Ensures that mutating the `Object` prototype does not influence the
parsing of `package.json` files.
PR-URL: https://github.com/nodejs/node/pull/44007
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2022-08-04 22:41:48 +00:00
Kohei Ueno
c8bea71bba
stream: update TextEncoderStream to align the latest spec
...
PR-URL: https://github.com/nodejs/node/pull/44101
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-08-04 22:41:28 +00:00
Jacob Smith
e0b440ae32
esm: fix loader hooks accepting too many arguments
...
PR-URL: https://github.com/nodejs/node/pull/44109
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-08-04 22:10:13 +00:00
Joyee Cheung
06f5d45647
bootstrap: support more builtins in the embedded code cache
...
This patch:
- Make NativeModuleLoader::LookupAndCompile() detect parameters based
on module IDs. This allows us to compile more builtins when
generating the embedded bootstrap, including
- internal/per_context/*
- internal/bootstrap/*
- internal/main/*
- Move pre_execution.js to lib/internal/process as it needs to be
compiled as a regular built-in module, unlike other scripts
in lib/internal/bootstrap
- Move markBootstrapComplete() to the performance binding instead of
making it a function-wrapper-based global to reduce number of
special cases.
PR-URL: https://github.com/nodejs/node/pull/44018
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2022-08-05 01:11:20 +08:00
flakey5 and James M Snell
64ad66bc99
lib: refactor transferable AbortSignal
...
Co-authored-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/44048
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-08-04 08:40:50 -07:00
Antoine du Hamel
5e1873e91d
test_runner: refactor to use more primordials
...
PR-URL: https://github.com/nodejs/node/pull/44062
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-08-04 04:03:28 +00:00
Adam Majer
ddd9c70674
net, dns: socket should handle its output as input
...
As a consequence of https://github.com/nodejs/node/issues/43014 ,
server sockets and others, once connected, report string family
names. But when feeding these to Socket.connect(), it passes
these to host resolution with a string for family while a numeric
family is expected internally. This results in wrong hints flags
to be set and resolution to fail.
As solution, is to add ability to handle both numeric and string
family names when doing lookup and connect.
Fixes: https://github.com/nodejs/node/issues/44003
PR-URL: https://github.com/nodejs/node/pull/44083
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-08-03 23:46:31 +00:00
Joyee Cheung
3611045dfc
bootstrap: clean up warning setup during serialization
...
PR-URL: https://github.com/nodejs/node/pull/38905
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-08-03 00:41:42 +08:00
Joyee Cheung
cb955e0dd1
net: create diagnostics channels lazily
...
PR-URL: https://github.com/nodejs/node/pull/38905
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-08-03 00:41:38 +08:00
Moshe Atlow
8cf33850be
test_runner: verbous error when entire test tree is canceled
...
PR-URL: https://github.com/nodejs/node/pull/44060
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-08-02 06:52:41 +01:00
Daeyeon Jeong
7f7a899fa5
net,tls: pass a valid socket on tlsClientError
...
On the 'tlsClientError' event, the `tlsSocket` instance is passed as
`closed` status. Thus, users can't get information such as `remote
address`, `remoteFamily`, and so on.
This adds a flag to close a socket after emitting an `error` event.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/44021
Fixes: https://github.com/nodejs/node/issues/43963
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-08-01 07:37:45 +01:00
Moshe Atlow
5ec2d7bc5d
test_runner: empty pending tests queue post running
...
PR-URL: https://github.com/nodejs/node/pull/44059
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-31 12:53:06 +01:00
Darshan Sen
42eb2e72de
src: use a typed array internally for process._exiting
...
This would prevent manual writes to the _exiting JS property on the
process object by passing the data directly via a typed array for
performance.
This change partially addresses this TODO:
https://github.com/nodejs/node/blob/3d575a4f1bd197c3ce669758a2a3c763462a883a/src/api/hooks.cc#L68-L71
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/43883
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2022-07-31 07:32:00 +01:00
Moshe Atlow
af0921d877
esm: add --import flag
...
PR-URL: https://github.com/nodejs/node/pull/43942
Fixes: https://github.com/nodejs/node/issues/40110
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-07-31 04:08:02 +01:00
Moshe Atlow
659dc12693
test_runner: add before/after/each hooks
...
PR-URL: https://github.com/nodejs/node/pull/43730
Fixes: https://github.com/nodejs/node/issues/43403
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-30 23:10:51 +03:00
theanarkh
60898eed65
lib: add diagnostics channel and perf hooks detail
...
PR-URL: https://github.com/nodejs/node/pull/43984
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-07-29 14:27:16 +01:00
theanarkh
20e372c242
http: make idle http parser count configurable
...
PR-URL: https://github.com/nodejs/node/pull/43974
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-07-29 10:00:38 +01:00
Jacob Smith
447635b440
test: refactor ESM tests to improve performance
...
PR-URL: https://github.com/nodejs/node/pull/43784
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-07-29 10:42:55 +02:00
Moshe Atlow
a3e110820f
test_runner: fix top level describe queuing
...
PR-URL: https://github.com/nodejs/node/pull/43998
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-28 10:54:09 +01:00
cola119
420666c1f2
lib: add missing env vars to --help
...
PR-URL: https://github.com/nodejs/node/pull/43492
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-07-28 05:43:55 +00:00
legendecas
803a7b2b23
src,lib: print source map error source on demand
...
The source context is not prepended to the value of the `stack` property
when the source map is not enabled. Rather than prepending the error
source context to the value of the `stack` property unconditionally,
this patch aligns the behavior and only prints the source context when
the error is not handled by userland (e.g. fatal errors).
Also, this patch fixes that when source-map support is enabled, the
error source context is not pointing to where the error was thrown.
PR-URL: https://github.com/nodejs/node/pull/43875
Fixes: https://github.com/nodejs/node/issues/43186
Fixes: https://github.com/nodejs/node/issues/41541
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-07-28 08:09:30 +08:00
ywave620
93e0bf9abf
http: reuse socket only when it is drained
...
Ensuring every request is assigned to a drained socket or nothing.
Because is has no benifit for a request to be attached to a non
drained socket and it prevents the request from being assigned to
a drained one, which might occur soon or already in the free pool
We achieve this by claiming a socket as free only when the socket
is drained.
PR-URL: https://github.com/nodejs/node/pull/43902
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2022-07-27 10:09:06 +01:00
Moshe Atlow
26e27424ad
test_runner: graceful termination on --test only
...
PR-URL: https://github.com/nodejs/node/pull/43977
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-27 08:02:07 +01:00
Antoine du Hamel
d7f193434a
lib: add Promise methods to avoid-prototype-pollution lint rule
...
PR-URL: https://github.com/nodejs/node/pull/43849
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2022-07-26 23:38:24 +01:00
theanarkh
d4423d63cd
net: add local family
...
PR-URL: https://github.com/nodejs/node/pull/43975
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-07-26 23:37:49 +01:00
Antoine du Hamel
60da0a1b36
test_runner: validate concurrency option
...
PR-URL: https://github.com/nodejs/node/pull/43976
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-26 23:37:41 +01:00
Geoffrey Booth
7ef40322b7
esm: move package config helpers
...
PR-URL: https://github.com/nodejs/node/pull/43967
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-07-26 05:08:18 +01:00
Daeyeon Jeong
9aef414b73
net: fix socket._getpeername
...
Fixes: https://github.com/nodejs/node/issues/43009
If calling `this._handle.getpeername` returns an error at the first
call, its result shouldn't be cached to `this._peername`.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/43010
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
2022-07-25 09:09:49 +01:00
Lenvin Gonsalves
dab492f044
test_runner: add support for boolean values for concurrency option
...
PR-URL: https://github.com/nodejs/node/pull/43887
Fixes: https://github.com/nodejs/node/issues/43837
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2022-07-24 23:41:46 +02:00
Antoine du Hamel
d83446b4c4
test_runner: validate timeout option
...
PR-URL: https://github.com/nodejs/node/pull/43843
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-07-24 23:11:16 +02:00
Daeyeon Jeong
0c27ca4bc9
stream: improve respondWithNewView()
...
This fixes validating an ArrayBufferView given to
ReadableStreamBYOBRequest.respondWithNewView() to improve the web
streams compatibility.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/43866
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-24 17:56:48 +01:00
Moshe Atlow
2e682f10b6
test_runner: pass signal on timeout
...
PR-URL: https://github.com/nodejs/node/pull/43911
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-07-24 15:16:10 +01:00
theanarkh
da3949cfd7
http: fix http server connection list when close
...
PR-URL: https://github.com/nodejs/node/pull/43949
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-07-24 15:06:24 +01:00
Mark S. Miller
5abd9baea8
process: use defineProperty instead of assignment
...
PR-URL: https://github.com/nodejs/node/pull/43907
Fixes: https://github.com/nodejs/node/issues/43496
Refs: https://github.com/endojs/endo/issues/576
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
2022-07-24 14:09:29 +02:00
Rhys
294ccf39a6
util: remove unicode support todo for perf implications
...
PR-URL: https://github.com/nodejs/node/pull/43762
Refs: https://github.com/nodejs/node/pull/43721
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2022-07-24 13:56:52 +02:00