summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-06-22add dynamic module loaderJonathan Buchanan
2020-12-22v8: refactor to use more primordialsAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/36527 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
2020-12-22child_process: clean event listener correctlyBenjamin Gruenbaum
I was working on AbortSignal for spawn and noticed there is a leak in the current code for AbortSignal support in child_process since it removes the wrong listener. I used the new signal as argument feature to make removing the listener easier and added a test. PR-URL: https://github.com/nodejs/node/pull/36424 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-22lib: refactor to use more primordials in internal/histogram.jsraisinten
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36455 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-22v8: fix native `serdes` constructorsExE Boss
Fixes: https://github.com/nodejs/node/issues/13326 Refs: https://github.com/nodejs/node/pull/13541 PR-URL: https://github.com/nodejs/node/pull/36549 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-12-22errors: eliminate all overhead for hidden callsMomtchil Momtchev
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: https://github.com/nodejs/node/issues/35386 PR-URL: https://github.com/nodejs/node/pull/35644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-21lib: support BigInt in querystring.stringifyraisinten
Fixes: https://github.com/nodejs/node/issues/36080 PR-URL: https://github.com/nodejs/node/pull/36499 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-12-21fs: refactor to use optional chainingZiJian Liu
PR-URL: https://github.com/nodejs/node/pull/36524 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-12-21repl: disable blocking completions by defaultAnna Henningsen
It’s not okay for the REPL to be blocked for multiple seconds after entering `require('` because the completion is performing blocking fs operations on potentially huge directories. Turning the REPL completion function asynchronous would be the right thing to do here, but unfortunately the way the code is structured doesn’t play well with that (in particular, it breaks the preview feature). Therefore, disable these blocking calls by default. Refs: https://github.com/nodejs/node/pull/33282#issuecomment-733646794 PR-URL: https://github.com/nodejs/node/pull/36564 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-20stream: fix pipe deadlock when starting with needDrainRobert Nagy
Fixes: https://github.com/nodejs/node/issues/36544 PR-URL: https://github.com/nodejs/node/pull/36563 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-17http: add test for incomingmessage destroyDaniele Belardi
Test uncaught exceptions when destroying IncomingMessage. PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: use standard args order in IncomingMEssage onErrorDaniele Belardi
PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: remove trailing spaceDaniele Belardi
PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: add comments in _http_incomingDaniele Belardi
PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: fix lint error in incoming messageDaniele Belardi
PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: reafactor incoming message destroyDaniele Belardi
Destroy the underlying socket only if it is not ready destroyed. Wait for the stream to finish in that case. PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17http: use `autoDestroy: true` in incoming messageDaniele Belardi
Enable the default `autoDestroy: true` option in IncomingMessage. Refactor `_http_client` and `_http_server` to remove any manual destroying/closing of IncomingMessage. Refactor IncomingMessage `destroy` method to use the standard implementation of the stream module and move the early termination event emitting inside of it. PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-15stream: accept iterable as a valid first argumentZiJian Liu
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-15readline: cursorTo throw error on NaNZijian Liu
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-15lib: make safe primordials safe to iterateAntoine du Hamel
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-14util: simplify constructor retrieval in inspect()Rich Trott
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-13http: use objects with null prototype in AgentMichaël Zasso
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-12tls: forward new SecureContext optionsAlba Mendez
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-12util: fix instanceof checks with null prototypes during inspectionRuben Bridgewater
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-12util: fix module prefixes during inspectionRuben Bridgewater
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-12child_process: add signal support to spawnBenjamin Gruenbaum
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-11Revert "perf_hooks: make PerformanceObserver an AsyncResource"Nicolai Stange
This reverts commit 009e41826f47c595ca994f673023f9380198be36. 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-10build,lib,test: change whitelist to allowlistMichaël Zasso
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-10stream: support abortsignal in constructorBenjamin Gruenbaum
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-10inspector: refactor to use more primordialsAntoine du Hamel
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-07dns: refactor to use more primordialsAntoine du Hamel
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-07tools: enable no-unused-expressions lint ruleMichaël Zasso
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-07net: refactor to use more primordialsAntoine du Hamel
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-07worker: refactor to use more primordialsAntoine du Hamel
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-07lib: add uncurried accessor properties to `primordials`ExE Boss
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-07http2: refactor to use more primordialsAntoine du Hamel
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-07string_decoder: refactor to use more primordialsAntoine du Hamel
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-07lib: fix typo in internal/errors.jsraisinten
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-07stream: support abort signalBenjamin Gruenbaum
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-07buffer: refactor to use primordials instead of Array#reduceAntoine du Hamel
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-06child_process: add AbortSignal supportBenjamin Gruenbaum
PR-URL: https://github.com/nodejs/node/pull/36308 Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-05stream: add FileHandle support to Read/WriteStreamMomtchil Momtchev
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-04readline: refactor to use more primordialsAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/36296 Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04dgram: refactor to use more primordialsAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/36286 Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-04zlib: refactor to use more primordialsAntoine du Hamel
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-04module: refactor to use more primordialsAntoine du Hamel
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-03child_process: refactor to use more primordialsZijian Liu
PR-URL: https://github.com/nodejs/node/pull/36269 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-03querystring: refactor to use more primordialsAntoine du Hamel
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-02path: refactor to use more primordialsAntoine du Hamel
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-02worker: refactor to use more primordialsAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/36267 Reviewed-By: Rich Trott <rtrott@gmail.com>