summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* vm: add run-after-evaluate microtask modeAnna Henningsen2020-06-261-2/+22
| | | | | | | | | | | | This allows timeouts to apply to e.g. `Promise`s and `async function`s from code running inside of `vm.Context`s, by giving the Context its own microtasks queue. Fixes: https://github.com/nodejs/node/issues/3020 PR-URL: https://github.com/nodejs/node/pull/34023 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* src: add errorProperties on process.reporthimself652020-06-262-3/+3
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28426 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* events: fix add-remove-add case in EventTargetAnna Henningsen2020-06-251-1/+1
| | | | | | | | | Make sure that listeners are added properly if there has previously been one but currently are none for a given event type. PR-URL: https://github.com/nodejs/node/pull/34056 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* Revert "repl: always check for NODE_REPL_MODE environment variable"Anna Henningsen2020-06-253-22/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b831b081c499a614c1ee3f0272c9de1783395402. This presumably unbreaks the ASAN github action build. Example failure: 2020-06-25T19:59:15.1448178Z === release test-repl-envvars === 2020-06-25T19:59:15.1448872Z Path: parallel/test-repl-envvars 2020-06-25T19:59:15.1449449Z --- stderr --- 2020-06-25T19:59:15.1449835Z assert.js:103 2020-06-25T19:59:15.1450194Z throw new AssertionError(obj); 2020-06-25T19:59:15.1450524Z ^ 2020-06-25T19:59:15.1450817Z 2020-06-25T19:59:15.1451431Z AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: 2020-06-25T19:59:15.1452000Z + actual - expected 2020-06-25T19:59:15.1452298Z 2020-06-25T19:59:15.1452634Z { 2020-06-25T19:59:15.1452978Z terminal: true, 2020-06-25T19:59:15.1453321Z + useColors: false 2020-06-25T19:59:15.1453861Z - useColors: true 2020-06-25T19:59:15.1454225Z } 2020-06-25T19:59:15.1454841Z at /home/runner/work/node/node/test/parallel/test-repl-envvars.js:55:12 2020-06-25T19:59:15.1455246Z at internal/repl.js:33:5 PR-URL: https://github.com/nodejs/node/pull/34058 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* fs: fix readdir failure when libuv returns UV_DIRENT_UNKNOWNKirill Shatskiy2020-06-251-3/+42
| | | | | | | | | Fixes: https://github.com/nodejs/node/issues/33348 PR-URL: https://github.com/nodejs/node/pull/33395 Refs: https://github.com/nodejs/node/issues/33348 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* repl: always check for NODE_REPL_MODE environment variableRuben Bridgewater2020-06-253-47/+22
| | | | | | | | | | | | | | This makes sure all REPL instances check for the NODE_REPL_MODE environment variable in case the `replMode` is not passed through as option. At the same time this simplifies the internal REPL code significantly. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33461 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib,src: remove cpu profiler idle notifierBen Noordhuis2020-06-252-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added it in commit 57231d5286 ("src: notify V8 profiler when we're idle") from October 2013 as a stop-gap measure to measure CPU time rather than wall clock time, otherwise processes that spend a lot of time sleeping in system calls give a false impression of being very busy. That fix is not without drawbacks because the idle flag is set before libuv makes I/O callbacks and cleared again after. I/O callbacks can result into calls into JS code and executing JS code is as non-idle as you can get. In commit 96ffcb9a21 ("src: reduce cpu profiler overhead") from January 2015, I made Node.js block off the SIGPROF signal that V8's CPU profiler uses before Node.js goes to sleep. The goal of that commit is to reduce the overhead from EINTR system call wakeups but it also has the pleasant side effect of fixing what the idle notifier tried to fix. This commit removes the idle notifier and turns the JS process object methods into no-ops. Fixes: https://github.com/nodejs/node/issues/19009 Refs: https://github.com/nodejs/node/pull/33138 PR-URL: https://github.com/nodejs/node/pull/34010 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* assert: add `assert/strict` alias moduleExE Boss2020-06-251-0/+3
| | | | | | | | | | | | 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>
* worker: add public method for marking objects as untransferableAnna Henningsen2020-06-253-6/+22
| | | | | | | | | | | | | | | We currently mark a number of `ArrayBuffer`s as not transferable, including the `Buffer` pool and ones with finalizers provided by C++ addons. There is no good reason to assume that userland code might not encounter similar problems, for example when doing `ArrayBuffer` pooling similar to ours. Therefore, provide an API that lets userland code also mark objects as not transferable. PR-URL: https://github.com/nodejs/node/pull/33979 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* http2: return this for Http2ServerRequest#setTimeoutPranshu Srivastava2020-06-251-3/+3
| | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/33993 PR-URL: https://github.com/nodejs/node/pull/33994 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* util: fix width detection for DEL without ICURuben Bridgewater2020-06-251-1/+1
| | | | | | | | | | | This makes sure the DEL character (ASCII 127) is detected as a zero width character even if Node.js is not built with ICU. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33650 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* util: support Combining Diacritical Marks for SymbolsRuben Bridgewater2020-06-251-0/+2
| | | | | | | | | | | | This adds support for the "Combining Diacritical Marks for Symbols" unicode group to calculate a zero length width even if Node.js is built without ICU. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33650 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* fs: fix realpath inode link cachingDenys Otrishko2020-06-241-3/+7
| | | | | | | | | | | | | | | | | The `fs.realpath` / `fs.realpathSync` cache already seen symbolic links using the inode number which may be longer that max supported JS number (2**53) and will therefore be incorrectly handled by possibly entering infinite loop of calling stat on the same node. This PR changes those functions (where appropriate) to use bigint for inode numbers. Fixes: https://github.com/nodejs/node/issues/33936 PR-URL: https://github.com/nodejs/node/pull/33945 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* querystring: fix stringify for empty arraysapics2020-06-241-7/+6
| | | | | | PR-URL: https://github.com/nodejs/node/pull/33918 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* timers: allow timers to be used as primitivesDenys Otrishko2020-06-242-0/+32
| | | | | | | | | | | | | | | | | | | | | This allows timers to be matched to numeric Ids and therefore used as keys of an Object, passed and stored without storing the Timer instance. clearTimeout/clearInterval is modified to support numeric/string Ids. Co-authored-by: Bradley Farias <bradley.meck@gmail.com> Co-authored-by: Anatoli Papirovski <apapirovski@mac.com> Refs: https://github.com/nodejs/node/pull/21152 PR-URL: https://github.com/nodejs/node/pull/34017 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* http: used already defined validator for boolean checkYash Ladha2020-06-241-9/+7
| | | | | | | | | | | | | We already importing the validator for integer check. So leveraging the boolean check validator to remove already defined logic in the code and thus making it DRY. PR-URL: https://github.com/nodejs/node/pull/33731 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* src: remove _third_party_main supportAnna Henningsen2020-06-242-15/+1
| | | | | | | | | | | | | | | | | | | | 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>
* net: check args in net.connect() and socket.connect() callsDenys Otrishko2020-06-241-1/+6
| | | | | | | | | | | | | | | | | | | Previously Node.js would handle empty `net.connect()` and `socket.connect()` call as if the user passed empty options object which doesn't really make sense. This was due to the fact that it uses the same `normalizeArgs` function as `.listen()` call where such call is perfectly fine. This will make it clear what is the problem with such call and how it can be resolved. It now throws `ERR_MISSING_ARGS` if no arguments were passed or neither `path` nor `port` is specified. Fixes: https://github.com/nodejs/node/issues/33930 PR-URL: https://github.com/nodejs/node/pull/34022 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
* lib: handle one of args case in ERR_MISSING_ARGSDenys Otrishko2020-06-241-1/+4
| | | | | | | | | | | | | | | | | | This makes ERR_MISSING_ARGS handle nested arrays in argument names as one-of case and will print them as '"arg1" or "arg2" or "arg3"'. Example: ```js throw new ERR_MISSING_ARGS(['a', 'b', 'c']); // will result in message: // The "a" or "b" or "c" argument must be specified ``` PR-URL: https://github.com/nodejs/node/pull/34022 Fixes: https://github.com/nodejs/node/issues/33930 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
* quic: updates to implement for h3-29James M Snell2020-06-242-13/+39
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/34033 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* events: improve argument handling, start passiveJames M Snell2020-06-231-6/+32
| | | | | | | | Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: support dispatching event from eventJames M Snell2020-06-231-11/+3
| | | | | | | | Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: support event handlersBenjamin Gruenbaum2020-06-231-2/+19
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: expose Event staticsBenjamin Gruenbaum2020-06-231-1/+6
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: Handle a range of this values for dispatchEventZirak2020-06-231-1/+22
| | | | | | | | | On the web, dispatchEvent is finicky about its `this` value. An exception is thrown for `this` values which are not an EventTarget. PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: fix EventTarget supportBenjamin Gruenbaum2020-06-231-35/+49
| | | | | | | | | | | | | | Remove support for multiple arguments (which don't actually work for EventTarget). Use our EventTarget implementation rather than a mock. Refactor `once` code in preparation of `on` using shared code for supporting `on` with `EventTarget`s. Support EventTarget in the `events.on` static method PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: fix depth in customInspectSymbol and clean upDenys Otrishko2020-06-231-11/+8
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* events: use internal/validators in event_target.jsDenys Otrishko2020-06-231-14/+8
| | | | | | PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* internal: rename error-serdes for consistencyEvan Lucas2020-06-233-2/+2
| | | | | | | | | | | | 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>
* fs: remove custom Buffer pool for streamsRobert Nagy2020-06-231-70/+30
| | | | | | | | | | | | | | The performance benefit of using a custom pool are negligable. Furthermore, it causes problems with Workers and transferrable. Rather than further adding complexity for compat with Workers, just remove the pooling logic. Refs: https://github.com/nodejs/node/issues/33880#issuecomment-644430693 Fixes: https://github.com/nodejs/node/issues/31733 PR-URL: https://github.com/nodejs/node/pull/33981 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* fs: implement lutimesMaël Nison2020-06-232-0/+33
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33399 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* timers: introduce timers/promisesJames M Snell2020-06-223-127/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* crypto: allow KeyObjects in postMessageTobias Nießen2020-06-221-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/33360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: store key data in separate classTobias Nießen2020-06-221-6/+6
| | | | | | | | | | | | | | | | | | This separates key handles from the actual key data: +-----------------+ | NativeKeyObject | +-----------------+ ^ extends | +-----------------+ +-----------------+ +---------------+ | KeyObject (JS) | -> | KeyObjectHandle | -> | KeyObjectData | +-----------------+ +-----------------+ +---------------+ PR-URL: https://github.com/nodejs/node/pull/33360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: add NativeKeyObject base classTobias Nießen2020-06-221-59/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------------------+ | BaseObject | +---------------------+ | | | +---------------------+ | NativeKeyObject | +---------------------+ | | | +---------------------+ | KeyObject | +---------------------+ / \ / \ / \ / \ +---------------------+ +---------------------+ | SecretKeyObject | | AsymmetricKeyObject | +---------------------+ +---------------------+ / \ / \ / \ / \ +---------------------+ +---------------------+ | PublicKeyObject | | PrivateKeyObject | +---------------------+ +---------------------+ PR-URL: https://github.com/nodejs/node/pull/33360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: rename internal key handles to KeyObjectHandleTobias Nießen2020-06-221-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/33360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* quic: refactor and improve ipv6OnlyJames M Snell2020-06-221-2/+4
| | | | | | | | | | | | | Ignore `ipv6Only: true` when binding to `'udp4'` (this differs from dgram which will still attempt to apply the flag and will fail during bind). Improve the test so that it should work consistently. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33935 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* http: expose host and protocol on ClientRequestwenningplus2020-06-221-0/+2
| | | | | | | | | | Allow host and protocol to be inspected. PR-URL: https://github.com/nodejs/node/pull/33803 Fixes: https://github.com/nodejs/node/issues/2461 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* http: add maxTotalSockets to agent classrickyes2020-06-211-4/+48
| | | | | | | | | | | Add maxTotalSockets to determine how many sockets an agent can open. Unlike maxSockets, The maxTotalSockets does not count by per origin. PR-URL: https://github.com/nodejs/node/pull/33617 Fixes: https://github.com/nodejs/node/issues/31942 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* timers: fix multipleResolves in promisified timeouts/immediatesDenys Otrishko2020-06-211-4/+8
| | | | | | | | | | | | After successful timer finish the abort event callback would still reject (already resolved promise) upon calling abortController.abort(). Signed-off-by: Denys Otrishko <shishugi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* fs: document why isPerformingIO is requiredRobert Nagy2020-06-211-0/+13
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33982 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* http: don't emit error after closeRobert Nagy2020-06-214-4/+20
| | | | | | | | Refs: https://github.com/nodejs/node/issues/33591 PR-URL: https://github.com/nodejs/node/pull/33654 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* http2: always call callback on Http2ServerResponse#endPranshu Srivastava2020-06-191-5/+8
| | | | | | | | | Fixes: https://github.com/nodejs/node/issues/28001 PR-URL: https://github.com/nodejs/node/pull/33911 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* module: fix error message about importing names from cjsFábio Santos2020-06-191-1/+3
| | | | | | | | | | | | | | | | | | | | | When importing specific names from a CJS module, and renaming them using `as`, the example fix in the error message erroneously contains the keyword `as` in the destructuring variable declaration. Example of this issue: import { parse as acornParse } from "acorn"; ^^^^^ SyntaxError: The requested module 'acorn' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export. For example: import pkg from 'acorn'; const { parse as acornParse } = pkg; PR-URL: https://github.com/nodejs/node/pull/33882 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* lib: remove manual exception handling in queueMicrotaskGus Caplan2020-06-191-8/+0
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/33859 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: remove NodeError from the prototype of errors with codeMichaël Zasso2020-06-191-24/+28
| | | | | | | | | | | Signed-off-by: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/33857 Refs: https://github.com/nodejs/node/pull/33770 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* domain: remove native domain codeStephen Belanger2020-06-192-4/+11
| | | | | | | | | | | | 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>
* async_hooks: callback trampoline for MakeCallbackStephen Belanger2020-06-191-0/+23
| | | | | | | | | 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>
* util: gracefully handle unknown colorsRuben Bridgewater2020-06-191-1/+2
| | | | | | | | | | | | | | | | | | This makes sure colors that are unknown won't cause an error. This is especially important in case a library wants to use colors defined by Node.js core, if available and fall back to the default otherwise. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33797 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: replace charCodeAt with fixed Unicoderickyes2020-06-193-6/+20
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/32758 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>