summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* fs: forbid concurrent operations on Dir handleAnna Henningsen2020-05-152-0/+38
| | | | | | | | | | | | | | | | | | | | | libuv does not expect concurrent operations on `uv_dir_t` instances, and will gladly create memory leaks, corrupt data, or crash the process. This patch forbids that, and: - Makes sure that concurrent async operations are run sequentially - Throws an exception if sync operations are attempted during an async operation The assumption here is that a thrown exception is preferable to a potential hard crash. This fully fixes flakiness from `parallel/test-fs-opendir` when run under ASAN. PR-URL: https://github.com/nodejs/node/pull/33274 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Revert "vm: add importModuleDynamically option to compileFunction"Matteo Collina2020-05-152-29/+28
| | | | | | | | | | | | | | This reverts commit 74c393dd93cc0e461e3796fbcc09545fcacdecaf. Fixes: https://github.com/nodejs/node/issues/33166 PR-URL: https://github.com/nodejs/node/pull/33364 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* module: do not check circular dependencies for exported proxiesRuben Bridgewater2020-05-151-5/+13
| | | | | | | | | | | | | | | In case the exported module is a proxy that has the `getPrototypeOf` or `setPrototypeOf` trap, skip the circular dependencies check. It would otherwise be triggered by the check itself. Fixes: https://github.com/nodejs/node/issues/33334 Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33338 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
* repl: improve repl autocompletion for require callsRuben Bridgewater2020-05-151-52/+44
| | | | | | | | | | | | | | | | | This improves the autocompletion for require calls. It had multiple small issues so far. Most important: it won't suggest completions for require statements that are fully written out. Second, it'll detect require calls that have whitespace behind the opening bracket. Third, it makes sure node modules are detected as such instead of only suggesting them as folders. Last, it adds suggestions for input that starts with backticks. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Fixes: https://github.com/nodejs/node/issues/33238 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* repl: replace hard coded core module list with actual listRuben Bridgewater2020-05-152-50/+13
| | | | | | | | | | | | | | | | | This replaces the internally used hard coded Node.js core module list with the actual internal existent modules. That way all modules are automatically picked up instead of having to update the list manually. This currently only applies to the REPL and to the Node.js `eval` functionality (User passed `-e` or `--eval` arguments to Node without `-i` or `--interactive`). Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* repl: show reference errors during previewRuben Bridgewater2020-05-152-6/+26
| | | | | | | | | | | | | This aligns the behavior with the one in the Firefox console. It will visualize ReferenceErrors in case the input has no possible completion and no buffered input. That way typos can already be highlighted before being evaluated. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* repl: improve repl previewRuben Bridgewater2020-05-152-11/+35
| | | | | | | | | | | | | | | This aligns the REPL preview with the one used in the Chrome DevTools console. It will now preview the output for the input including the completion suffix as input. When pressing enter while previewing such data, it will automatically insert the suffix before evaluating the input. When pressing escape, that behavior is deactivated until the input is changed. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* src: add support for TLAGus Caplan2020-05-145-24/+29
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/30370 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* tls: fix --tls-keylog optionAlba Mendez2020-05-141-37/+32
| | | | | | | | | | | | | | | | | There's a typo that causes only the first socket to be logged (i.e. when the warning is emitted). In addition, server sockets aren't logged because `keylog` events are not emitted on tls.Server, not the socket. This behaviour is counterintuitive and has caused more bugs in the past, so make all sockets (server or client) emit 'keylog'. tls.Server will just re-emit these events. Refs: https://github.com/nodejs/node/pull/30055 PR-URL: https://github.com/nodejs/node/pull/33366 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* src: add primordials to arguments commentDaniel Bevenius2020-05-131-1/+1
| | | | | | | | | | | | This commit adds the primordials argument to the comment of arguments passed to bootstrap/node.js. PR-URL: https://github.com/nodejs/node/pull/33318 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
* http: don't destroy completed requestRobert Nagy2020-05-111-1/+4
| | | | | | | | | | | | Calling destroy() on a completed ClientRequest, i.e. once 'close' will be emitted should be a noop. Also before emitting 'close' destroyed === true. Fixes: https://github.com/nodejs/node/issues/32851 PR-URL: https://github.com/nodejs/node/pull/33120 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* http: emit 'error' on aborted server requestRobert Nagy2020-05-102-1/+13
| | | | | | | | | | | | | | | | | | Server requests aka. IncomingMessage emits 'aborted' instead of 'error' which causes confusion when the object is used as a regular stream, i.e. if functions working on streams are passed a server request object they might not work properly unless they take this into account. Refs: https://github.com/nodejs/web-server-frameworks/issues/41 PR-URL: https://github.com/nodejs/node/pull/33172 Fixes: https://github.com/nodejs/node/issues/28172 Refs: https://github.com/nodejs/node/pull/28677 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: fix typo in timers insert function commentDaniel Bevenius2020-05-101-1/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33301 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* perf_hooks: fix error message for invalid entryTypesMichaël Zasso2020-05-101-5/+6
| | | | | | | | | | | Will now print a more meaningful value instead of always [object Object] PR-URL: https://github.com/nodejs/node/pull/33285 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* http: return this from OutgoingMessage#destroy()cjihrig2020-05-091-1/+3
| | | | | | | | | | | This commit updates OutgoingMessage#destroy() to return `this` for consistency with other writable streams. PR-URL: https://github.com/nodejs/node/pull/32789 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* http: return this from ClientRequest#destroy()cjihrig2020-05-091-1/+3
| | | | | | | | | | | This commit updates ClientRequest#destroy() to return `this` for consistency with other writable streams. PR-URL: https://github.com/nodejs/node/pull/32789 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* http: return this from IncomingMessage#destroy()cjihrig2020-05-091-0/+1
| | | | | | | | | | | | This commit updates IncomingMessage#destroy() to return `this` for consistency with other readable streams. PR-URL: https://github.com/nodejs/node/pull/32789 Fixes: https://github.com/nodejs/node/issues/32772 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: improve copy() performanceNikolai Vavilov2020-05-091-1/+1
| | | | | | | | | | There is no need to create a slice when sourceEnd is out of bounds. PR-URL: https://github.com/nodejs/node/pull/33214 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* tls: reset secureConnecting on client socketDavid Halls2020-05-091-0/+2
| | | | | | | | | | | | | | secureConnecting is never set to false on client TLS sockets. So if Http2Session constructor (in lib/internal/http2/core.js) is called after secureConnect is emitted, then it will wrongly wait for a secureConnect event. This fix sets secureConnecting to false when a client TLS socket has connected. PR-URL: https://github.com/nodejs/node/pull/33209 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* fs: add .ref() and .unref() methods to watcher classesrickyes2020-05-092-2/+59
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/33134 Fixes: https://github.com/nodejs/node/issues/33096 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* http: set IncomingMessage.destroyedRobert Nagy2020-05-093-1/+14
| | | | | | | | | | IncomingMessage is a Readable stream and should properly set the destroyed property. PR-URL: https://github.com/nodejs/node/pull/33131 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* http: expose http.validate-header-name/valueosher2020-05-092-0/+6
| | | | | | | | | | | | The use-case is for any framework that provides user mw a response replacement, that collects the desired response state, and applies them only on conclusion. As such a framework, I'd want to validate the header names and values as soon as the user-code provides them. This - to eliminate errors on response-send time, and provide developer stack trace that contains the line that submits the offending values. PR-URL: https://github.com/nodejs/node/pull/33119 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* zlib: reject windowBits=8 when mode=GZIPBen Noordhuis2020-05-091-1/+3
| | | | | | | | | | It's also handled in C++ land now, per the previous commit, but intercepting it in JS land makes for prettier error messages. PR-URL: https://github.com/nodejs/node/pull/33045 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: David Carlier <devnexen@gmail.com>
* async_hooks: move PromiseHook handler to JSStephen Belanger2020-05-092-5/+74
| | | | | | | | | | | | | | | This avoids the need to wrap every promise in an AsyncWrap and also makes it easier to skip the machinery to track destroy events when there's no destroy listener. Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32891 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* lib: refactored scheduling policy assignmentYash Ladha2020-05-091-10/+11
| | | | | | | | | | | | In previous implementation it was clubbed into declaration of scheduling policies and fetching the schedulingPolicy. Now they are separate variables, so that in future if one want to add new scheduling policy. It is much simpler and not obsfucated. PR-URL: https://github.com/nodejs/node/pull/32663 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* module: better error for named exports from cjsMyles Borins2020-05-081-0/+27
| | | | | | | | | | | | | We do not support importing named exports from a CJS module. This change decorates the error message for missing named exports in the case where the module being imported is expected to be CJS by the ESM loader. Signed-off-by: Myles Borins <myles.borins@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33256 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* http: cleanup end argument handlingRobert Nagy2020-05-081-39/+46
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31818 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* lib: fix grammar in internal/bootstrap/loaders.jsszTheory2020-05-081-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/33211 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* module: lazy load 'getOptionValue' in initializeLoaderhimself652020-05-081-2/+2
| | | | | | | | | | This enables loading this module during early bootstrapping. PR-URL: https://github.com/nodejs/node/pull/33212 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
* stream: make from read one at a timeRobert Nagy2020-05-061-0/+2
| | | | | | | | | | | | | | | | Currently from will eagerly buffer up items which means that errors are also eagerly encountered and items which are buffer when an error occurs will be discarded, which is inconsistent with how generators work. Fixes: https://github.com/nodejs/node/issues/29428 PR-URL: https://github.com/nodejs/node/pull/33201 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* http: fixes memory retention issue with FreeList and HTTPParserJohn Leidegren2020-05-051-2/+2
| | | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/29394 Refs: https://github.com/nodejs/node/pull/33167#issuecomment-622102450 PR-URL: https://github.com/nodejs/node/pull/33190 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* http: ensure client request emits closeRobert Nagy2020-05-042-25/+22
| | | | | | | | | | If socket creation failed then an error would be emitted on the client request object, but not 'close' nor would destroyed be set to true. PR-URL: https://github.com/nodejs/node/pull/33178 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: update c8 ignore commentbcoe2020-05-031-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/33151 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* esm: improve commonjs hint on module not foundDaniele Belardi2020-05-031-6/+84
| | | | | | | | | | | Run CommonJS resolver only if `error.code` is ERR_MODULE_NOT_FOUND. Avoid using absolute paths in hint by: * using a parent-relative path if the specifier is a relative path * using a `pkg/x.js` format if the specifier is bare (e.g. `pkg/x`) PR-URL: https://github.com/nodejs/node/pull/31906 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* http: simplify sending headerRobert Nagy2020-05-031-13/+5
| | | | | | | | | | | | unshifting into an empty array is the same as creating a new array. PR-URL: https://github.com/nodejs/node/pull/33200 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* http: set default timeout in agent keepSocketAliveOwen Smith2020-04-301-5/+5
| | | | | | | | | | | | | | | | Previous location of setting the timeout would override behaviour of custom HttpAgents' keepSocketAlive. Moving it into the default keepSocketAlive allows it to interoperate with custom agents. Fixes: https://github.com/nodejs/node/issues/33111 PR-URL: https://github.com/nodejs/node/pull/33127 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
* stream: remove unused _transformStateRobert Nagy2020-04-301-6/+0
| | | | | | | | | | | _transformState is no longer used since Transform was simplified. Refs: https://github.com/nodejs/node/pull/32763 PR-URL: https://github.com/nodejs/node/pull/33105 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* stream: fix stream.finished on DuplexRobert Nagy2020-04-301-4/+12
| | | | | | | | | | | finished would incorrectly believe that a Duplex is already closed if either the readable or writable side has completed. Fixes: https://github.com/nodejs/node/issues/33130 PR-URL: https://github.com/nodejs/node/pull/33133 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* vm: fix vm.measureMemory() and introduce execution optionJoyee Cheung2020-04-301-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/nodejs/node-v8/pull/147 broke the `vm.measureMemory()` API. It only created a `MeasureMemoryDelegate` and without actually calling `v8::Isolate::MeasureMemory()` so the returned promise will never resolve. This was not caught by the tests because the promise resolvers were not wrapped with `common.mustCall()`. This patch migrates the API properly and also introduce the newly added execution option to the API. It also removes support for specifying contexts to measure - instead we'll just return the measurements for all contexts in the detailed mode, which is what the `performance.measureMemory()` prototype in V8 currently does. We can consider implementing our own `v8::MeasureMemoryDelegate` to select the target context in `ShouldMeasure()` in the future, but then we'll also need to implement `MeasurementComplete()` to assemble the result. For now it's probably too early to do that. Since this API is still experimental (and guarded with a warning), such breakage should be acceptable. Refs: https://github.com/nodejs/node-v8/pull/147 PR-URL: https://github.com/nodejs/node/pull/32988 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* stream: simplify Readable push/unshift logichimself652020-04-301-7/+9
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/32899 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* module: no type module resolver side effectsGuy Bedford2020-04-291-8/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/33086 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
* lib: cosmetic change to builtinLibs list for maintainabilityJames M Snell2020-04-291-5/+33
| | | | | | | | | | | | | | | This is a largely cosmetic change suggested for easier maintainability of the builtinLibs list. While the QUIC PR no longer modifies this list, the original version of the PR did and the fact that all of the entries were bundled up into the same lines meant that adding one forced a larger change to all. With this PR, when we want to add a new built-in, it won't impact any of the others. PR-URL: https://github.com/nodejs/node/pull/33106 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* stream: add null check in Readable.fromPranshu Srivastava2020-04-291-5/+11
| | | | | | | | | | | | | Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to `Readable.from`. Also added docs for the same. Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com> Fixes: https://github.com/nodejs/node/issues/32845 PR-URL: https://github.com/nodejs/node/pull/32873 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* worker: add stack size resource limit optionAnna Henningsen2020-04-291-1/+5
| | | | | | | | | | | Add `stackSizeMb` to the `resourceLimit` option group. Refs: https://github.com/nodejs/node/pull/31593#issuecomment-619633820 PR-URL: https://github.com/nodejs/node/pull/33085 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* stream: let Duplex re-use Writable propertiesRobert Nagy2020-04-291-37/+14
| | | | | | | | | | | Instead of reimplementing Writable properties, fetch them from the Writable prototype. PR-URL: https://github.com/nodejs/node/pull/33079 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* console: support console constructor groupIndentation optionrickyes2020-04-291-6/+21
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/32964 Fixes: https://github.com/nodejs/node/issues/32947 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: generator must be int32 in DiffieHellman()Ben Noordhuis2020-04-281-1/+3
| | | | | | | | | | | | | | Validate the generator argument in `crypto.createDiffieHellman(key, g)`. When it's a number, it should be an int32. Fixes: https://github.com/nodejs/node/issues/32748 PR-URL: https://github.com/nodejs/node/pull/32739 Fixes: https://github.com/nodejs/node/issues/32738 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: key size must be int32 in DiffieHellman()Ben Noordhuis2020-04-281-1/+11
| | | | | | | | | | | | | | The JS code accepted any value where `typeof sizeOrKey === 'number'` was true but the C++ code checked that `args[0]->IsInt32()` and subsequently aborted. Fixes: https://github.com/nodejs/node/issues/32738 PR-URL: https://github.com/nodejs/node/pull/32739 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* cluster: fix error on worker disconnect/destroySantiago Gimeno2020-04-281-2/+9
| | | | | | | | | | | | Avoid sending multiple `exitedAfterDisconnect` messages when concurrently calling `disconnect()` and/or `destroy()` from the worker so `ERR_IPC_DISCONNECTED` errors are not generated. Fixes: https://github.com/nodejs/node/issues/32106 PR-URL: https://github.com/nodejs/node/pull/32793 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: fix validateport error message when allowZero is falserickyes2020-04-282-3/+7
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/32861 Fixes: https://github.com/nodejs/node/issues/32857 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>