Commit Graph

8618 Commits (4a6200e28947af3a7e1f65a332f3d391bc967a67)

Author SHA1 Message Date
ZiJian Liu 6837a6de97 stream: accept iterable as a valid first argument
Fixes: https://github.com/nodejs/node/issues/36437

PR-URL: https://github.com/nodejs/node/pull/36479
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-15 13:40:40 +00:00
Zijian Liu 45dbcbef90 readline: cursorTo throw error on NaN
Fixes: https://github.com/nodejs/node/issues/36301

PR-URL: https://github.com/nodejs/node/pull/36379
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-12-15 14:26:51 +01:00
Antoine du Hamel 0a5969c62a lib: make safe primordials safe to iterate
PR-URL: https://github.com/nodejs/node/pull/36391
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-15 13:25:55 +00:00
Rich Trott f43d1ca3b0 util: simplify constructor retrieval in inspect()
Instead of looping through a list of typed arrays, use
TypedArrayPrototypeGetSymbolToStringTag.

PR-URL: https://github.com/nodejs/node/pull/36466
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-14 05:42:06 -08:00
Michaël Zasso 2ef9a76ece
http: use objects with null prototype in Agent
Fixes: https://github.com/nodejs/node/issues/36364

PR-URL: https://github.com/nodejs/node/pull/36409
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-13 22:16:18 +01:00
Alba Mendez 78d1f8db5d tls: forward new SecureContext options
We have a few places where we individually forward each
parameter to tls.createSecureContext(). In #28973 and others,
we added new SecureContext options but forgot to keep these
places up to date.

As per https.Agent#getName, I understand that at least
`privateKeyIdentifier` and `privateKeyEngine` should be
added too, since they're a substitute for `key`. I've
also added sigalgs.

Fixes: https://github.com/nodejs/node/issues/36322
Refs: https://github.com/nodejs/node/pull/28973

PR-URL: https://github.com/nodejs/node/pull/36416
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-12 23:59:58 +01:00
Ruben Bridgewater 1e665095c8 util: fix instanceof checks with null prototypes during inspection
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

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

PR-URL: https://github.com/nodejs/node/pull/36178
Fixes: https://github.com/nodejs/node/issues/36151
Refs: https://github.com/nodejs/node/pull/35754
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-12 20:58:02 +00:00
Ruben Bridgewater f78da00ab7 util: fix module prefixes during inspection
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

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

PR-URL: https://github.com/nodejs/node/pull/36178
Fixes: https://github.com/nodejs/node/issues/35730
Refs: https://github.com/nodejs/node/pull/35754
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-12 20:58:01 +00:00
Benjamin Gruenbaum 738cd60418 child_process: add signal support to spawn
PR-URL: https://github.com/nodejs/node/pull/36432
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-12 16:46:24 +00:00
Nicolai Stange 1ea4b83912 Revert "perf_hooks: make PerformanceObserver an AsyncResource"
This reverts commit 009e41826f.

AFAIU the discussion at [1], PerformanceObserver had been made to
inherit from AsyncResource more or less as a band-aid in lack of a
better async_context candidate to invoke it in. In order to enable
access to AsyncLocalStores from PerformanceObservers invoked
synchronously through e.g. measure() or mark(), the current
async_context, if any, should be retained.

Note that this is a breaking change, but
- as has been commented at [1], PerformanceObserver being derived from
  AsyncResource is a "minor divergence from the spec" anyway,
- to my knowledge this is an internal implementation detail which has
  never been documented and
- I can't think of a good reason why existing PerformanceObserver
  implementations would possibly rely on it.

OTOH, it's probably worthwhile to not potentially invoke before() and
after() async_hooks for each and every PerformanceObserver notification.

[1] https://github.com/nodejs/node/pull/18789

Co-Authored-By: ZauberNerd <zaubernerd@zaubernerd.de>

PR-URL: https://github.com/nodejs/node/pull/36343
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-11 04:45:29 -08:00
Michaël Zasso 7e5bf48998 build,lib,test: change whitelist to allowlist
PR-URL: https://github.com/nodejs/node/pull/36406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-10 20:21:26 -05:00
Benjamin Gruenbaum 040a27ae5f stream: support abortsignal in constructor
PR-URL: https://github.com/nodejs/node/pull/36431
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-12-10 23:39:18 +02:00
Antoine du Hamel 806588361a inspector: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36356
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-12-10 17:06:03 +00:00
Antoine du Hamel 96b4950dca dns: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36314
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-07 19:40:52 +00:00
Michaël Zasso bf31d3c3b1
tools: enable no-unused-expressions lint rule
Fixes: https://github.com/nodejs/node/issues/36246

PR-URL: https://github.com/nodejs/node/pull/36248
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 20:33:45 +01:00
Antoine du Hamel 0869b829fa
net: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36303
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 10:08:03 -08:00
Antoine du Hamel 23f4b6ead7
worker: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36393
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 10:03:55 -08:00
ExE Boss c83e599420
lib: add uncurried accessor properties to `primordials`
Closes: https://github.com/nodejs/node/pull/32127

PR-URL: https://github.com/nodejs/node/pull/36329
Fixes: https://github.com/nodejs/node/issues/32127
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 10:02:34 -08:00
Antoine du Hamel b5bb09448a
http2: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36357
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 10:01:29 -08:00
Antoine du Hamel 4027e36dfd
string_decoder: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36358
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 09:59:42 -08:00
raisinten 7e5fc9c792
lib: fix typo in internal/errors.js
PR-URL: https://github.com/nodejs/node/pull/36426
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 09:56:31 -08:00
Benjamin Gruenbaum 5bd1eecfa9 stream: support abort signal
PR-URL: https://github.com/nodejs/node/pull/36061
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-12-07 16:08:31 +00:00
Antoine du Hamel ff048bd797 buffer: refactor to use primordials instead of Array#reduce
PR-URL: https://github.com/nodejs/node/pull/36392
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-12-07 06:08:44 +01:00
Benjamin Gruenbaum 20de5f7efc child_process: add AbortSignal support
PR-URL: https://github.com/nodejs/node/pull/36308
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-06 12:23:19 +02:00
Momtchil Momtchev 0fd121e00c stream: add FileHandle support to Read/WriteStream
Support creating a Read/WriteStream from a
FileHandle instead of a raw file descriptor
Add an EventEmitter to FileHandle with a single
'close' event.

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

PR-URL: https://github.com/nodejs/node/pull/35922
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-05 00:50:06 +01:00
Antoine du Hamel ed6e71a1ca readline: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36296
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04 18:34:32 +00:00
Antoine du Hamel e074bee7da dgram: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36286
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04 18:34:22 +00:00
Antoine du Hamel e4d570fe9a zlib: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04 06:22:18 -08:00
Antoine du Hamel 3604fadacf module: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36348
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04 06:19:12 -08:00
Zijian Liu f7dd330ba0 child_process: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36269
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-03 21:57:17 +00:00
Antoine du Hamel a897a25d1d querystring: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36315
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-03 09:23:59 -08:00
Antoine du Hamel 187a862d22 path: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36302
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-02 20:22:34 +00:00
Antoine du Hamel 325a1fcd64 worker: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36267
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-02 20:22:24 +00:00
Antoine du Hamel f066ae4dd8 tls: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36266
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-02 20:22:14 +00:00
Antoine du Hamel 825029ec59 repl: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36264
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-02 20:22:03 +00:00
Benjamin Gruenbaum ef8d0e9798 events: support signal in EventTarget
PR-URL: https://github.com/nodejs/node/pull/36258
Fixes: https://github.com/nodejs/node/issues/36073
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-02 14:55:08 +00:00
Rich Trott 4a741b8dc2 tls: permit null as a cipher value
Allow null along with undefined for cipher value.

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

PR-URL: https://github.com/nodejs/node/pull/36318
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-12-02 06:07:24 -08:00
Benjamin Gruenbaum 1ed72f67f5 timers: reject with AbortError on cancellation
PR-URL: https://github.com/nodejs/node/pull/36317
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-12-01 18:51:05 +00:00
Antoine du Hamel 7d45dd9aa3 buffer: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36166
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-01 17:44:27 +01:00
James M Snell 9e446b3e9f
worker: add experimental BroadcastChannel
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36271
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-12-01 08:02:28 -08:00
bcoe 09fd8f13c8
errors: display original symbol name
If symbol names array has been populated in source map, include
original symbol name in error message.

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

PR-URL: https://github.com/nodejs/node/pull/36042
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-01 07:23:56 -08:00
Antoine du Hamel 1d82d1e566 perf_hooks: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36297
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-12-01 14:28:03 +00:00
Antoine du Hamel dbfb10dd36 v8: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36285
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-01 14:27:53 +00:00
Antoine du Hamel e6e708400b os: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36284
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-01 14:27:43 +00:00
James M Snell 8ff2501a04
module: add isPreloading indicator
Adds a `module.isPreloading` property that is `true` only during the
preload (`-r`) phase of Node.js bootstrap. This provides modules an
easy, non-hacky way of knowing if they are being loaded during preload.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36263
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-30 08:26:46 -08:00
pooja d.p dedd0612f0 http: enable call chaining with setHeader()
Make `response.setHeader` return the response object itself
so that multiple header setting can be chained.

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

PR-URL: https://github.com/nodejs/node/pull/35924
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-30 05:14:30 -08:00
Zijian Liu 6ca7312f0e tty: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36272
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-29 05:57:36 -08:00
Zijian Liu b938f88204 fs: pass ERR_DIR_CLOSED asynchronously to dir.close
Pass the error to the callback or returns a rejected Promise instead of
throwing a synchonous error.

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

PR-URL: https://github.com/nodejs/node/pull/36243
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-11-27 18:43:41 +01:00
Antoine du Hamel 8d6c2f2ada fs: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36196
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-11-27 18:40:51 +01:00
Antoine du Hamel b4c2ff5a3b policy: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36210
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-11-27 17:19:30 +00:00