summaryrefslogtreecommitdiff
path: root/node.gyp
Commit message (Collapse)AuthorAgeFilesLines
* readline: move utilities to internal modulesAntoine du Hamel2021-05-021-0/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/38466 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* lib: add support for JSTransferable as a mixinJames M Snell2021-04-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new `makeTransferable()` utility that can construct a `JSTransferable` object that does not directly extend the `JSTransferable` JavaScript class. Because JavaScript does not support multiple inheritance, it is not possible (without help) to implement a class that extends both `JSTransferable` and, for instance, `EventTarget` without incurring a significant additional complexity and performance cost by making all `EventTarget` instances extend `JSTransferable`... That is, we *don't* want: ```js class EventTarget extends JSTransferable { ... } ``` The `makeTransferable()` allows us to create objects that are backed internally by `JSTransferable` without having to actually extend it by leveraging the magic of `Reflect.construct()`. ```js const { JSTransferable, kClone, kDeserialize, kConstructor, makeTransferable, } = require('internal/worker/js_transferable'); class E { constructor(b) { this.b = b; } } class F extends E { [kClone]() { /** ... **/ } [kDeserialize]() { /** ... **/ } static [kConstructor]() { return makeTransferable(F); } } const f = makeTransferable(F, 1); f instanceof F; // true f instanceof E; // true f instanceof JSTransferable; // false const mc = new MessageChannel(); mc.port1.onmessage = ({ data }) => { data instanceof F; // true data instanceof E; // true data instanceof JSTransferable; // false }; mc.port2.postMessage(f); // works! ``` The additional `internal/test/transfer.js` file is required for the test because successfully deserializing transferable classes requires that they be located in `lib/internal` for now. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38383 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Khaidi Chu <i@2333.moe>
* debugger: move node-inspect to internal libraryRich Trott2021-04-251-3/+3
| | | | | | | | | | | | | | | node-inspect developers have agreed to move node-inspect into core rather than vendor it as a dependency. Refs: https://github.com/nodejs/node/discussions/36481 PR-URL: https://github.com/nodejs/node/pull/38161 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* net: add SocketAddress classJames M Snell2021-04-021-0/+1
| | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37917 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* lib: make process.binding('util') return only type checkersAnna Henningsen2021-03-271-0/+1
| | | | | | | | | | | | | | | Ref: https://github.com/nodejs/node/pull/37485#pullrequestreview-600060802 Ref: https://github.com/nodejs/node/pull/37787 PR-URL: https://github.com/nodejs/node/pull/37819 Refs: https://github.com/nodejs/node/pull/37787 Reviewed-By: James M Snell <jasnell@gmail.com> 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> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
* crypto: fix header nameJiawen Geng2021-03-211-1/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/37792 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: load v8_prof_processor dependencies as ESMMichaël Zasso2021-03-151-11/+11
| | | | | | | | | The script versions are no longer available. PR-URL: https://github.com/nodejs/node/pull/37587 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* stream: move duplicated code to an internal moduleRich Trott2021-02-281-0/+1
| | | | | | | | | | | Create a utils module for isIterable(), isReadable(), and isStream(). PR-URL: https://github.com/nodejs/node/pull/37508 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* perf_hooks: complete overhaul of the implementationJames M Snell2021-02-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Update the user timing implementation to conform to User Timing Level 3. * Reimplement user timing and timerify with pure JavaScript implementations * Simplify the C++ implementation for gc and http2 perf * Runtime deprecate additional perf entry properties in favor of the standard detail argument * Disable the `buffered` option on PerformanceObserver, all entries are queued and dispatched on setImmediate. Only entries with active observers are buffered. * This does remove the user timing and timerify trace events. Because the trace_events are still considered experimental, those can be removed without a deprecation cycle. They are removed to improve performance and reduce complexity. Old: `perf_hooks/usertiming.js n=100000: 92,378.01249733355` New: perf_hooks/usertiming.js n=100000: 270,393.5280638482` PR-URL: https://github.com/nodejs/node/pull/37136 Refs: https://github.com/nodejs/diagnostics/issues/464 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* src: refactor v8 bindingJoyee Cheung2021-02-081-0/+1
| | | | | | | | | | | | | | | 1. Put the v8 binding data class into a header so we can reuse the class definition during deserialization. 2. Put the v8 binding code into node::v8_utils namespace for clarity. 3. Move the binding data property initialization into its constructor so that we can reuse it during deserialization 4. Reorder the v8 binding initialization so that we don't unnecessarily initialize the properties in a loop PR-URL: https://github.com/nodejs/node/pull/37112 Refs: https://github.com/nodejs/node/pull/36943 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* src: put (de)serialization code into node_snapshotable.h/ccJoyee Cheung2021-02-051-0/+2
| | | | | | | | So that it's easier to find the corresponding code. PR-URL: https://github.com/nodejs/node/pull/37114 Refs: https://github.com/nodejs/node/pull/36943 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* quic: remove quicJames M Snell2021-01-301-56/+0
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/37067 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* src: rename crypto_ecdh.(h|cc) to crypto_ec.(h|cc)Tobias Nießen2021-01-251-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/37048 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* buffer: introduce BlobJames M Snell2021-01-181-0/+3
| | | | | | | | | | | | The `Blob` object is an immutable data buffer. This is a first step towards alignment with the `Blob` Web API. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36811 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* crypto: introduce X509Certificate APIJames M Snell2021-01-091-0/+3
| | | | | | | | | | | | | | | | | | Introduces the `crypto.X509Certificate` object. ```js const { X509Certificate } = require('crypto'); const x509 = new X509Certificate('{pem encoded cert}'); console.log(x509.subject); ``` Fixes: https://github.com/nodejs/node/issues/29181 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36804 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* lib,src: update cluster to use ParentMichael Dawson2021-01-051-1/+1
| | | | | | | | | | | | | | | Doc deprecate isMaster and setupMaster in favor of isPrimary and setupPrimary. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/36478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com>
* child_process: add 'overlapped' stdio flagThiago Padilha2021-01-031-0/+18
| | | | | | | | | | | The 'overlapped' value sets the UV_OVERLAPPED_PIPE libuv flag in the child process stdio. Fixes: https://github.com/nodejs/node/issues/29238 PR-URL: https://github.com/nodejs/node/pull/29412 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* stream: support abort signalBenjamin Gruenbaum2020-12-071-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/36061 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
* module: refactor to use iterable-weak-mapbcoe2020-11-061-0/+1
| | | | | | | | | | | Using an iterable WeakMap (a data-structure that uses WeakRef and WeakMap), we are able to: stop relying on Module._cache to serialize source maps; stop requiring an error object when calling findSourceMap(). PR-URL: https://github.com/nodejs/node/pull/35915 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* lib: create diagnostics_channel moduleStephen Belanger2020-10-311-0/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/34895 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
* deps: update acorn to v8.0.4Michaël Zasso2020-10-271-1/+0
| | | | | | | | | | | | | | | This adds support for nullish coalescing, optional chaining and numeric separators. The acorn-numeric-separator plugin can be removed. PR-URL: https://github.com/nodejs/node/pull/35791 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* src: mark/pop OpenSSL errors in NewRootCertStoreDaniel Bevenius2020-10-211-0/+3
| | | | | | | | | | | | | | | | | | | | | This commit sets the OpenSSL error mark before calling X509_STORE_load_locations and pops the error mark afterwards. The motivation for this is that it is possible that X509_STORE_load_locations can produce errors if the configuration option --openssl-system-ca-path file does not exist. Later if a different function is called which calls an OpenSSL function it could fail because these errors might still be on the OpenSSL error stack. Currently, all functions that call NewRootCertStore clear the OpenSSL error queue upon returning, but this was not the case for example in v12.18.0. PR-URL: https://github.com/nodejs/node/pull/35514 Fixes: https://github.com/nodejs/node/issues/35456 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* util: add `util/types` alias moduleExE Boss2020-10-211-0/+1
| | | | | | | | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/31553 Refs: https://github.com/nodejs/node/pull/32953 Refs: https://github.com/nodejs/node/pull/33950 Refs: https://github.com/nodejs/node/pull/34001 Refs: https://github.com/nodejs/node/pull/34002 PR-URL: https://github.com/nodejs/node/pull/34055 Refs: https://github.com/nodejs/node/pull/34962 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* path: add `path/posix` and `path/win32` alias modulesExE Boss2020-10-201-0/+2
| | | | | | | | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/31553 Refs: https://github.com/nodejs/node/pull/32953 Refs: https://github.com/nodejs/node/pull/33950 Refs: https://github.com/nodejs/node/pull/34001 Refs: https://github.com/nodejs/node/pull/34002 Refs: https://github.com/nodejs/node/pull/34055 PR-URL: https://github.com/nodejs/node/pull/34962 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* src: large pages support in illumos/solaris systemsDavid Carlier2020-10-191-2/+2
| | | | | | | | | | Making sure using apis supported by both. PR-URL: https://github.com/nodejs/node/pull/34320 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* src: combine TLSWrap/SSLWrapJames M Snell2020-10-151-5/+3
| | | | | | | | | | | | | SSLWrap was needlessly defined as a template class, splitting the TLS implementation over multiple locations. The original idea, I surmise, was to make it possible to reuse SSLWrap for some other purpose that never manifest. This squashes them down into a single TLSWrap class and moves tls_wrap.h/cc into src/crypto. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35552 Reviewed-By: Alba Mendez <me@alba.sh>
* src: add embedding helpers to reduce boilerplate codeAnna Henningsen2020-10-141-0/+1
| | | | | | | | | | | | | Provide helpers for a) spinning the event loop and b) setting up and tearing down the objects involved in a single Node.js instance, as they would typically be used. The former helper is also usable inside Node.js itself, for both Worker and main threads. PR-URL: https://github.com/nodejs/node/pull/35597 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* module: use Wasm CJS lexer when availableGuy Bedford2020-10-121-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/35583 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
* build: fuzzer that targets node::LoadEnvironment()davkor2020-10-091-0/+43
| | | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/34761 Refs: https://github.com/nodejs/node/issues/33724 PR-URL: https://github.com/nodejs/node/pull/34844 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
* crypto: refactoring internals, add WebCryptoJames M Snell2020-10-071-3/+51
| | | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/678 Refs: https://github.com/nodejs/node/issues/26854 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* crypto: move node_crypto files to src/cryptoJames M Snell2020-10-071-8/+8
| | | | | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* src: create helper for reading Uint32BEJuan José Arboleda2020-09-301-0/+1
| | | | | | | Fixes: https://github.com/nodejs/node/issues/34827 PR-URL: https://github.com/nodejs/node/pull/34944 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* module: named exports for CJS via static analysisGuy Bedford2020-09-281-0/+1
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/35249 Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
* stream: move to internal/streamsMatteo Collina2020-09-211-0/+5
| | | | | | | | | | | | Move all the streams constructors to internal/streams and avoid a circular dependencies between the modules. See: https://github.com/nodejs/readable-stream/issues/348 PR-URL: https://github.com/nodejs/node/pull/35239 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
* policy: implement scopes fieldBradley Farias2020-08-261-1/+0
| | | | | PR-URL: https://github.com/nodejs/node/pull/34552 Reviewed-By: James M Snell <jasnell@gmail.com>
* build: add build flag for OSS-Fuzz integrationdavkor2020-08-151-0/+33
| | | | | | | | | | | Refs: https://github.com/google/oss-fuzz/pull/3860 Fixes: https://github.com/nodejs/node/issues/33724 PR-URL: https://github.com/nodejs/node/pull/34761 Fixes: https://github.com/nodejs/node/issues/33724 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
* policy: support conditions for redirectsBradley Farias2020-08-131-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34414 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
* net: introduce net.BlockListJames M Snell2020-08-111-0/+1
| | | | | | | | | | | `net.BlockList` provides an object intended to be used by net APIs to specify rules for disallowing network activity with specific IP addresses. This commit adds the basic mechanism but does not add the specific uses. PR-URL: https://github.com/nodejs/node/pull/34625 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
* quic: use OpenSSL built-in cert and hostname validationJames M Snell2020-07-311-2/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/34533 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* build: define NODE_EXPERIMENTAL_QUIC in mkcodecache and node_mksnapshotJoyee Cheung2020-07-221-0/+10
| | | | | | | | | | | | | | | Otherwise the build would fail with `./configure --experimental-quic --ninja` as the list of per-Environment values would not match and the code cache builder would not generate code cache for the quic JS sources. This is more or less a band-aid - a proper fix would be to aggregate these flags into something that can be included by all these different binary targets. See https://github.com/nodejs/node/issues/31074. PR-URL: https://github.com/nodejs/node/pull/34454 Fixes: https://github.com/nodejs/node/issues/34435 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* src: add an ExternalReferenceRegistry classJoyee Cheung2020-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an ExternalReferenceRegistry class for registering static external references. To register the external JS to C++ references created in a binding (e.g. when a FunctionTemplate is created): - Add the binding name (same as the id used for `internalBinding()` and `NODE_MODULE_CONTEXT_AWARE_INTERNAL`) to `EXTERNAL_REFERENCE_BINDING_LIST` in `src/node_external_reference.h`. - In the file where the binding is implemented, create a registration function to register the static C++ references (e.g. the C++ functions in `v8::FunctionCallback` associated with the function templates), like this: ```c++ void RegisterExternalReferences( ExternalReferenceRegistry* registry) { registry->Register(cpp_func_1); } ``` - At the end of the file where `NODE_MODULE_CONTEXT_AWARE_INTERNAL` is also usually called, register the registration function with ``` NODE_MODULE_EXTERNAL_REFERENCE(binding_name, RegisterExternalReferences); ``` PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* stream: simpler and faster Readable async iteratorRobert Nagy2020-07-171-1/+0
| | | | | | | | | | Reimplement as an async generator instead of a custom iterator class. PR-URL: https://github.com/nodejs/node/pull/34035 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* stream: add promises version to utility functionsrickyes2020-07-091-0/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33991 Fixes: https://github.com/nodejs/node/issues/33582 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
* src: add TimerWrap utilityJames M Snell2020-07-051-0/+2
| | | | | | | | | | | | | | Consolidate uv_timer_t boilerplate code into a shared utility. There are several places throughout the code where we use uv_timer_t internally (inspector, perf, quic), with some code duplication. This eliminates the duplicated code, ensures that cleanup occurs correctly, and simplifies use of the timers. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34186 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* assert: add `assert/strict` alias moduleExE Boss2020-06-251-0/+1
| | | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/31553 Refs: https://github.com/nodejs/node/pull/32953 PR-URL: https://github.com/nodejs/node/pull/34001 Refs: https://github.com/nodejs/node/pull/34002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: remove _third_party_main supportAnna Henningsen2020-06-241-1/+0
| | | | | | | | | | | | | | | | | | | | Since 7dead8440c7ee, there is a more official alternative that is tested and comes with a proper API, and since a6c57cc66d0, the `LoadEnvironment(env)` overload is deprecated, which is the closest thing we can achieve to deprecating `_third_party_main` support. Thus, we can now consider us able to remove `_third_party_main` support. Fixes: https://github.com/nodejs/node/issues/24017 Refs: https://github.com/nodejs/node/pull/30467 Refs: https://github.com/nodejs/node/pull/32858 PR-URL: https://github.com/nodejs/node/pull/33971 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* internal: rename error-serdes for consistencyEvan Lucas2020-06-231-1/+1
| | | | | | | | | | | | All other JavaScript files in lib use snake case, so make this one consistent. PR-URL: https://github.com/nodejs/node/pull/33793 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* timers: introduce timers/promisesJames M Snell2020-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the promisified timers implementations into a new sub-module to avoid the need to promisify. The promisified versions now return the timers/promises versions. Also adds `ref` option to the promisified versions ```js const { setTimeout, setImmediate } = require('timers/promises'); setTimeout(10, null, { ref: false }) .then(console.log); setImmediate(null, { ref: false }) .then(console.log); ``` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33950 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* domain: remove native domain codeStephen Belanger2020-06-191-1/+0
| | | | | | | | | | | | With the async_hooks callback trampoline, domains no longer need any native code. With this, domains can exist in pure JavaScript. PR-URL: https://github.com/nodejs/node/pull/33801 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* quic: initial QUIC implementationJames M Snell2020-06-161-0/+47
| | | | | | | | | | | | | | | Co-authored-by: Anna Henningsen <anna@addaleax.net> Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com> Co-authored-by: gengjiawen <technicalcute@gmail.com> Co-authored-by: James M Snell <jasnell@gmail.com> Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com> Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com> Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com> Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com> Co-authored-by: Denys Otrishko <shishugi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>