yuzheng14
0c8539e336
events: fix bug listenerCount don't compare wrapped listener
...
When add listener by once, it will be wrapped into another function.
And when pass listener and there is just one event listener added by
once, it will return 0 even if passed listener equal wrapped event
listener.
Refs: https://github.com/nodejs/node/pull/46523
PR-URL: https://github.com/nodejs/node/pull/48592
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-07-10 06:33:51 +00:00
Chengzhong Wu
38dee8a1c0
src: distinguish HTML transferable and cloneable
...
The HTML structured serialize algorithm treats transferable and
serializable as two different bits. A web platform interface can be
both transferable and serializable.
Splits BaseObject::TransferMode to be able to compose the two bits
and distinguishes the transferable and cloneable.
PR-URL: https://github.com/nodejs/node/pull/47956
Refs: https://github.com/v8/v8/commit/cf13b9b46572a9824d2d632abdd48c56161ace02
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
2023-07-07 17:00:00 +00:00
Yagiz Nizipli
3205b1936a
lib: remove aix directory case for package reader
...
PR-URL: https://github.com/nodejs/node/pull/48605
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2023-07-07 15:31:33 +00:00
Devraj Mehta
b5e16adb1d
http2: send RST code 8 on AbortController signal
...
Fixes: https://github.com/nodejs/node/issues/47321
Refs: https://www.rfc-editor.org/rfc/rfc7540#section-7
PR-URL: https://github.com/nodejs/node/pull/48573
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-07-06 00:59:39 +00:00
Chemi Atlow
c3ab184373
events: allow safely adding listener to abortSignal
...
PR-URL: https://github.com/nodejs/node/pull/48596
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2023-07-05 22:04:23 +00:00
Moshe Atlow
56b8de1699
timers: support Symbol.dispose
...
PR-URL: https://github.com/nodejs/node/pull/48633
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2023-07-05 13:39:38 +00:00
Moshe Atlow
773fde29a9
child_process: support Symbol.dispose
...
PR-URL: https://github.com/nodejs/node/pull/48551
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-07-05 10:21:14 +00:00
Chengzhong Wu
c47ea21685
bootstrap: hide experimental web globals with flag kNoBrowserGlobals
...
Do not install experimental web globals when the environment is
initialized with embedder flag
`node::EnvironmentFlags::kNoBrowserGlobals`.
PR-URL: https://github.com/nodejs/node/pull/48545
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2023-07-05 07:02:59 +00:00
Raz Luvaton
99881304c4
test_runner: add shards support
...
PR-URL: https://github.com/nodejs/node/pull/48639
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-07-05 03:57:28 +00:00
b40f0c3074
lib: add navigator.hardwareConcurrency
...
Co-authored-by: Mestery <mestery@protonmail.com >
Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/47769
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-07-04 22:55:34 +00:00
Rafael Gonzaga and haxatron
74c2d9c8a3
permission: v8.writeHeapSnapshot and process.report
...
Co-Authored-By: haxatron <haxatron1@gmail.com >
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com >
PR-URL: https://github.com/nodejs/node/pull/48564
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-07-04 13:12:48 +00:00
Antoine du Hamel
3ce51ae9c0
module: harmonize error code between ESM and CJS
...
PR-URL: https://github.com/nodejs/node/pull/48606
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-07-04 09:52:56 +00:00
Vinicius Lourenço
a2a8e31cbc
src,lib: reducing C++ calls of esm legacy main resolve
...
Instead of many C++ calls, now we make only one C++ call
to return a enum number that represents the selected state.
PR-URL: https://github.com/nodejs/node/pull/48325
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2023-07-03 18:42:47 +00:00
Shocker
d312bd96d3
test_runner: fixed test shorthands return type
...
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: https://github.com/nodejs/node/issues/48557
PR-URL: https://github.com/nodejs/node/pull/48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-07-03 09:04:11 +00:00
Luigi Pinca
651c02cbbc
http: null the joinDuplicateHeaders property on cleanup
...
Null the `joinDuplicateHeaders` property when the parser is freed.
Refs: https://github.com/nodejs/node/pull/45982
PR-URL: https://github.com/nodejs/node/pull/48608
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
2023-07-03 06:20:13 +00:00
Yagiz Nizipli
951da5282c
lib: merge cjs and esm package json reader caches
...
PR-URL: https://github.com/nodejs/node/pull/48477
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-29 18:45:31 +00:00
atlowChemi
e8810b91f1
https: server add asyncDispose
...
PR-URL: https://github.com/nodejs/node/pull/48548
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-29 11:53:05 +03:00
atlowChemi
b7bfb17bef
http2: server add asyncDispose
...
PR-URL: https://github.com/nodejs/node/pull/48548
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-29 11:52:58 +03:00
atlowChemi
909b43fe3a
http: server add async dispose
...
PR-URL: https://github.com/nodejs/node/pull/48548
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-29 11:52:51 +03:00
Benjamin Gruenbaum
1683e6030e
test: add Symbol.dispose support to mock timers
...
PR-URL: https://github.com/nodejs/node/pull/48549
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
2023-06-29 07:45:44 +00:00
Tim Perry
86ba5bea9e
tls: add ALPNCallback server option for dynamic ALPN negotiation
...
PR-URL: https://github.com/nodejs/node/pull/45190
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
2023-06-28 14:30:30 +00:00
Paolo Insogna
fddd3ffa59
net: improve network family autoselection handle handling
...
PR-URL: https://github.com/nodejs/node/pull/48464
Fixes: https://github.com/npm/cli/issues/6409
Fixes: https://github.com/KararTY/dank-twitch-irc/issues/13
Fixes: https://github.com/nodejs/node/issues/47644
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-06-27 09:17:16 +00:00
killa
32eb4921db
fs: call the callback with an error if writeSync fails
...
Catch SyncWriteStream write file error.
Fixes: https://github.com/nodejs/node/issues/47948
Signed-off-by: killagu <killa123@126.com >
PR-URL: https://github.com/nodejs/node/pull/47949
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-06-26 14:18:58 +00:00
Luigi Pinca
d09ff0db70
fs: remove unneeded return statement
...
The `writable._write()` implementation does not need to return anything,
only call the callback.
PR-URL: https://github.com/nodejs/node/pull/48526
Reviewed-By: Keyhan Vakil <kvakil@sylph.kvakil.me >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com >
2023-06-26 09:01:35 +00:00
ignoramous
7202859402
net: do not treat server.maxConnections=0 as Infinity
...
Setting the `maxConnections` to 0 should result in no connection.
Instead, it was treated as if the option was not there.
PR-URL: https://github.com/nodejs/node/pull/48276
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2023-06-26 06:17:51 +00:00
Moshe Atlow
7cd4e70948
test_runner: support passing globs
...
PR-URL: https://github.com/nodejs/node/pull/47653
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-06-25 14:40:34 +00:00
Moshe Atlow
1948dce707
fs: add globSync implementation
...
this is currently for internal use only,
with a synchrnous API.
PR-URL: https://github.com/nodejs/node/pull/47653
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-06-25 14:40:33 +00:00
Moshe Atlow and Benjamin Gruenbaum
71d7707792
fs, stream: initial Symbol.dispose and Symbol.asyncDispose support
...
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/48518
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-25 11:18:54 +00:00
Chemi Atlow
78f6952751
fs: use kResistStopPropagation
...
PR-URL: https://github.com/nodejs/node/pull/48521
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-06-24 15:52:38 +00:00
Robert Nagy
cebbc57ed2
stream: fix premature pipeline end
...
Fixes: https://github.com/nodejs/node/issues/48406
PR-URL: https://github.com/nodejs/node/pull/48435
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-06-24 07:58:03 +00:00
Yagiz Nizipli
578ffe1edb
lib: reduce url getters on makeRequireFunction
...
PR-URL: https://github.com/nodejs/node/pull/48492
Refs: https://github.com/nodejs/performance/issues/92
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-06-24 00:33:22 +00:00
isaacs
e26ffe7358
module: add SourceMap.findOrigin
...
This adds the `SourceMap.findOrigin(lineNumber, columnNumber)` method,
for finding the origin source file and 1-indexed line and column numbers
corresponding to the 1-indexed line and column numbers from a call site
in generated source code.
Fix : #47770
PR-URL: https://github.com/nodejs/node/pull/47790
Fixes: https://github.com/nodejs/node/issues/47770
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-06-23 19:17:14 +00:00
Yagiz Nizipli
049052e083
lib: remove duplicated requires in check_syntax
...
PR-URL: https://github.com/nodejs/node/pull/48508
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-06-23 15:17:26 +00:00
Chemi Atlow
bcd35c334e
lib: add option to force handling stopped events
...
PR-URL: https://github.com/nodejs/node/pull/48301
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-06-22 13:38:02 +00:00
Erick Wendel
da80964a3d
test_runner: add initial draft for fakeTimers
...
Signed-off-by: Erick Wendel <erick.workspace@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/47775
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-06-22 04:01:52 +00:00
RafaelGSS
205f1e643e
permission: handle fs path traversal
...
PR-URL: https://github.com/nodejs-private/node-private/pull/403
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1952978
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
CVE-ID: CVE-2023-30584
2023-06-20 17:31:47 -03:00
RafaelGSS
e15cc4595a
permission: handle fs.openAsBlob
...
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1966492
PR-URL: https://github.com/nodejs-private/node-private/pull/405
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
CVE-ID: CVE-2023-30583
2023-06-20 17:31:42 -03:00
RafaelGSS
daaa43ed96
policy: handle mainModule.__proto__ bypass
...
PR-URL: https://github.com/nodejs-private/node-private/pull/416
Fixes: https://hackerone.com/bugs?subject=nodejs&report_id=1877919
Reviewed-By: Rich Trott <rtrott@gmail.com >
CVE-ID: CVE-2023-30581
2023-06-20 17:31:28 -03:00
Rafael Gonzaga
ff14b24e12
lib: fix output message when repl is used with pm
...
PR-URL: https://github.com/nodejs/node/pull/48438
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-06-17 17:28:38 +00:00
Yagiz Nizipli
5613e223d5
src: return uint32 for guessHandleType
...
PR-URL: https://github.com/nodejs/node/pull/48349
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-06-15 19:21:49 +00:00
Chemi Atlow
f3ee4e2c96
lib: create weakRef only if any signals provided
...
PR-URL: https://github.com/nodejs/node/pull/48448
Fixes: https://github.com/nodejs/node/issues/48419
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-06-15 12:55:12 +00:00
Chengzhong Wu
ee1b6ab498
lib: remove obsolete deletion of bufferBinding.zeroFill
...
PR-URL: https://github.com/nodejs/node/pull/47881
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
2023-06-15 06:24:51 +00:00
Chengzhong Wu
77df1d84c7
lib: move web global bootstrapping to the expected file
...
PR-URL: https://github.com/nodejs/node/pull/47881
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
2023-06-15 06:24:50 +00:00
Moshe Atlow
8bc6e193a0
test_runner: add enqueue and dequeue events
...
PR-URL: https://github.com/nodejs/node/pull/48428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-06-13 18:33:43 +00:00
Chemi Atlow
d4e99b1a66
stream: remove asIndexedPairs
...
PR-URL: https://github.com/nodejs/node/pull/48150
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-06-13 12:54:45 +00:00
linkgoron
bd7a8087a5
https: fix connection checking interval not clearing on server close
...
The connection interval should close when httpsServer.close is called
similarly to how it gets cleared when httpServer.close is called.
fixes: https://github.com/nodejs/node/issues/48373
PR-URL: https://github.com/nodejs/node/pull/48383
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-06-12 07:47:25 +00:00
João Lenon
a40a6c890a
module: implement register utility
...
PR-URL: https://github.com/nodejs/node/pull/46826
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-06-12 00:00:46 +00:00
Antoine du Hamel
d2d4a310f1
typings: fix JSDoc in ESM loader modules
...
PR-URL: https://github.com/nodejs/node/pull/48424
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-06-11 21:09:21 +02:00
Moshe Atlow
c21fe3ad87
test_runner: make --test-name-pattern recursive
...
PR-URL: https://github.com/nodejs/node/pull/48382
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2023-06-11 15:02:18 +00:00
Debadree Chatterjee
8cc14387a2
lib: fix blob.stream() causing hanging promises
...
Refs: https://github.com/nodejs/node/issues/47993#issuecomment-1546901936
PR-URL: https://github.com/nodejs/node/pull/48232
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-06-11 09:24:39 +00:00