summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-10-12domain: do not import util for a simple type checkRuben Bridgewater
This removes `require('util')` from the `domain` module. There was only a single simple type check used from the `util` module which is now inlined instead. PR-URL: https://github.com/nodejs/node/pull/29825 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-10-12fs: make FSWatcher.start privateLucas Holmquist
* This is a semver-major change to rename the FSWatcher.start function to FSWatcher._start to make it private The motivation here is that it serves no purpose to the end user. An instance of FSWatcher is returned when a user calls fs.watch, which will call the start method. A user can't create an instance of a FSWatcher directly. If the start method is called by a user it is a noop since the watcher has already started. Calling start after a watcher has closed is also a noop PR-URL: https://github.com/nodejs/node/pull/29905 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-12fs: add runtime deprecate for file stream open()Robert Nagy
WriteStream.open() and ReadStream.open() are undocumented internal APIs that do not make sense to use in userland. File streams should always be opened through their corresponding factory methods (fs.createWriteStream() and fs.createReadStream()) or by passing a file descriptor in options. PR-URL: https://github.com/nodejs/node/pull/29061 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-11crypto: reject public keys properlyTobias Nießen
Fixes: https://github.com/nodejs/node/issues/29904 PR-URL: https://github.com/nodejs/node/pull/29913 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-10-12http: add reusedSocket property on client requestthemez
Set ClientRequest.reusedSocket property when reusing socket for request, so user can handle retry base on wether the request is reusing a socket. Refs: https://github.com/request/request/issues/3131 PR-URL: https://github.com/nodejs/node/pull/29715 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com>
2019-10-12net: treat ENOTCONN at shutdown as successAnna Henningsen
While it is not entirely clear why this condition is being triggered, it does resolve a reported bug. Fixes: https://github.com/nodejs/node/issues/26315 PR-URL: https://github.com/nodejs/node/pull/29912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-11module: warn on require of .js inside type: moduleGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/29909 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-11fs: buffer dir entries in opendir()Anna Henningsen
Read up to 32 directory entries in one batch when `dir.readSync()` or `dir.read()` are called. This increases performance significantly, although it introduces quite a bit of edge case complexity. confidence improvement accuracy (*) (**) (***) fs/bench-opendir.js mode='async' dir='lib' n=100 *** 155.93 % ±30.05% ±40.34% ±53.21% fs/bench-opendir.js mode='async' dir='test/parallel' n=100 *** 479.65 % ±56.81% ±76.47% ±101.32% fs/bench-opendir.js mode='sync' dir='lib' n=100 10.38 % ±14.39% ±19.16% ±24.96% fs/bench-opendir.js mode='sync' dir='test/parallel' n=100 *** 63.13 % ±12.84% ±17.18% ±22.58% PR-URL: https://github.com/nodejs/node/pull/29893 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-10-11repl: check for NODE_REPL_EXTERNAL_MODULEGus Caplan
PR-URL: https://github.com/nodejs/node/pull/29778 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-10-10util: validate formatWithOptions inspectOptionsRuben Bridgewater
This makes sure that the `inspectOptions` are validated. This could otherwise cause confusion. Fixes: https://github.com/nodejs/node/issues/29726 PR-URL: https://github.com/nodejs/node/pull/29824 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-10-10http2: fix file close error condition at respondWithFdAnna Henningsen
Closing a FileHandle almost never fails, so it was hard to notice before that `stream.emit(err)` would not emit an error event due to the missing event name. Destroying the stream with the error seems like the right thing to do in that scenario. PR-URL: https://github.com/nodejs/node/pull/29884 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2019-10-10esm: unflag --experimental-exportsGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/29867 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-10src: bring 425 status code name into accordance with RFC 8470Sergei Osipov
PR-URL: https://github.com/nodejs/node/pull/29880 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-10Revert "stream: make finished call the callback if the stream is closed"Matteo Collina
This reverts commit b03845b9376aec590b89f753a4b7c1b47729c5f8. PR-URL: https://github.com/nodejs/node/pull/29717 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2019-10-10Revert "stream: remove ambiguous code"Matteo Collina
This reverts commit ce62e963a13044817b43b7a7c6ef794eaa5ae905. PR-URL: https://github.com/nodejs/node/pull/29717 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2019-10-09fs: remove options.encoding from Dir.read*()Jeremiah Senkpiel
This is unlikely to be necessary in any case, and causes much unwarrented complexity when implementing further optimizations. Refs: https://github.com/nodejs/node/pull/29893#discussion_r333179482 PR-URL: https://github.com/nodejs/node/pull/29908 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-09http2: allow passing FileHandle to respondWithFDAnna Henningsen
This seems to make sense if we want to promote the use of `fs.promises`, although it’s not strictly necessary. PR-URL: https://github.com/nodejs/node/pull/29876 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-08Revert "esm: remove experimental status from JSON modules"Guy Bedford
This reverts commit ec8776da6fa77628e12718bb38cee687303d4137. PR-URL: https://github.com/nodejs/node/pull/29754 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
2019-10-08fs: introduce `opendir()` and `fs.Dir`Jeremiah Senkpiel
This adds long-requested methods for asynchronously interacting and iterating through directory entries by using `uv_fs_opendir`, `uv_fs_readdir`, and `uv_fs_closedir`. `fs.opendir()` and friends return an `fs.Dir`, which contains methods for doing reads and cleanup. `fs.Dir` also has the async iterator symbol exposed. The `read()` method and friends only return `fs.Dirent`s for this API. Having a entry type or doing a `stat` call is deemed to be necessary in the majority of cases, so just returning dirents seems like the logical choice for a new api. Reading when there are no more entries returns `null` instead of a dirent. However the async iterator hides that (and does automatic cleanup). The code lives in separate files from the rest of fs, this is done partially to prevent over-pollution of those (already very large) files, but also in the case of js allows loading into `fsPromises`. Due to async_hooks, this introduces a new handle type of `DIRHANDLE`. This PR does not attempt to make complete optimization of this feature. Notable future improvements include: - Moving promise work into C++ land like FileHandle. - Possibly adding `readv()` to do multi-entry directory reads. - Aliasing `fs.readdir` to `fs.scandir` and doing a deprecation. Refs: https://github.com/nodejs/node-v0.x-archive/issues/388 Refs: https://github.com/nodejs/node/issues/583 Refs: https://github.com/libuv/libuv/pull/2057 PR-URL: https://github.com/nodejs/node/pull/29349 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-10-07http2: support passing options of http2.connect to net.connectZYSzys
PR-URL: https://github.com/nodejs/node/pull/29816 Fixes: https://github.com/nodejs/node/issues/29811 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-10-07assert: fix line number calculation after V8 upgradeMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/29694 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2019-10-06module: use v8 synthetic modulesGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/29846 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-10-05tools: prohibit Error.prepareStackTrace() usageRuben Bridgewater
This eslint rule makes sure that `prepareStackTrace()` is not used in Node.js core. PR-URL: https://github.com/nodejs/node/pull/29827 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2019-10-05lib: make tick processor detect xcodebuild errorsBen Noordhuis
`node --prof-process` on macOS calls out to nm(1) to look up C++ symbols. If Xcode hasn't been properly installed or its license hasn't been accepted yet, it prints out an error and exits. Before this commit, that error was swallowed and the output of the tick processor was not showing the C++ entry points. This commit detects that error message and turns it into an exception. No regression test because this particular condition is hard to test for without going to extreme lengths to mock the output of nm. Fixes: https://github.com/nodejs/node/issues/29804 PR-URL: https://github.com/nodejs/node/pull/29830 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-05dgram: use `uv_udp_try_send()`Anna Henningsen
This improves dgram performance by avoiding unnecessary async operations. One issue with this commit is that it seems hard to actually create conditions under which the fallback path to the async case is actually taken, for all supported OS, so an internal CLI option is used for testing that path. Another caveat is that the lack of an async operation means that there are slight timing differences (essentially `nextTick()` rather than `setImmediate()` for the send callback). PR-URL: https://github.com/nodejs/node/pull/29832 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-10-05stream: do not deadlock duplexpairRobert Nagy
If nothing is buffered then _read will not be called and the callback will not be invoked, effectivly deadlocking. Fixes: https://github.com/nodejs/node/issues/29758 PR-URL: https://github.com/nodejs/node/pull/29836 Refs: https://github.com/nodejs/node/pull/29649 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-10-05esm: remove proxy for builtin exportsBradley Farias
PR-URL: https://github.com/nodejs/node/pull/29737 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-10-05process: add source-map support to stack tracesbcoe
PR-URL: https://github.com/nodejs/node/pull/29564 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-05lib: introduce no-mixed-operators eslint rule to libZYSzys
PR-URL: https://github.com/nodejs/node/pull/29834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-10-05http2: set default maxConcurrentStreamsZYSzys
Set the default maxConcurrentStreams to NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS. PR-URL: https://github.com/nodejs/node/pull/29833 Fixes: https://github.com/nodejs/node/issues/29763 Refs: https://github.com/nghttp2/nghttp2/commit/16c46114dc724278beaa6d59462f8396f35fa4a9 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-10-03tls: honor pauseOnConnect optionRobert Jensen
`pauseOnConnect` is now passed along to the net.Socket constructor from the tls.Socket constructor. The `readable` flag must match the value of `pauseOnConnect`. Tests were added to cover all available net.Server options when used in the tls.Server constructor. Fixes: https://github.com/nodejs/node/issues/29620 Refs: https://github.com/nodejs/node/pull/27665 PR-URL: https://github.com/nodejs/node/pull/29635 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-03net: emit close on unconnected socketRobert Nagy
Socket should always emit 'close'. Regardless whether it has been connected or not. PR-URL: https://github.com/nodejs/node/pull/29803 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-10-03stream: add comment about undocumented APIRobert Nagy
PR-URL: https://github.com/nodejs/node/pull/29805 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-03crypto: remove arbitrary UTF16 restrictionAnna Henningsen
Since 71f633a32f1f5617, this is no longer necessary. Refs: https://github.com/nodejs/node/pull/22622 Fixes: https://github.com/nodejs/node/issues/29793 PR-URL: https://github.com/nodejs/node/pull/29795 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-10-03errors: make sure all Node.js errors show their propertiesRuben Bridgewater
This improves Node.js errors by always showing the attached properties when inspecting such an error. This applies especially to SystemError. It did often not show any properties but now all properties will be visible. This is done in a mainly backwards compatible way. Instead of using prototype getters and setters, the property is now set directly on the error. PR-URL: https://github.com/nodejs/node/pull/29677 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-10-02doc: add missing deprecation codecjihrig
PR-URL: https://github.com/nodejs/node/pull/29820 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-10-02lib: stop using prepareStackTraceGus Caplan
PR-URL: https://github.com/nodejs/node/pull/29777 Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-02vm: refactor SourceTextModuleGus Caplan
- Removes redundant `instantiate` method - Refactors `link` to match the spec linking steps more accurately - Removes URL validation from SourceTextModule specifiers - DRYs some dynamic import logic Closes: https://github.com/nodejs/node/issues/29030 Co-Authored-By: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/29776 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-10-02http2: use the latest settingsZYSzys
Fixes: https://github.com/nodejs/node/issues/29764 PR-URL: https://github.com/nodejs/node/pull/29780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-02doc: add documentation deprecation for process._tickCallbackLucas Holmquist
This change also supports --pending-deprecation for the new deprecation. PR-URL: https://github.com/nodejs/node/pull/29781 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-01assert: special handle identical error names in instance checksRuben Bridgewater
This makes sure that using `assert.throws()` or `assert.rejects()` in combination with Error classes log appropriate error messages in case the expected and received constructor name are identical but not part of the same prototype chain. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01assert: add more information to AssertionErrorsRuben Bridgewater
This adds information about the actual thrown error to the AssertionError's message property. It also improves the logged error instances error name by using the constructors name, if available. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01assert: do not repeat .throws() codeRuben Bridgewater
This refactors some code for less duplication. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01assert: wrap validation function errorsRuben Bridgewater
This makes sure that validation function used by `assert.throws` and `assert.rejects` always throw validatin errors instead of rethrowing the received error. That should improve the debugging experience for developers since they have a better context where the error is coming from and they also get to know what triggered it. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01assert: fix generatedMessage propertyRuben Bridgewater
This makes sure the `generatedMessage` property is always set as expected. This was not the case some `assert.throws` and `assert.rejects` calls. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01assert: improve class instance errorsRuben Bridgewater
This improves `assert.throws()` and `assert.rejects()` in case error classes are used as validation for the expected error. In case of a failure it will now throw an `AssertionError` instead of the received error if the check fails. That error has the received error as actual property and the expected property is set to the expected error class. The error message should help users to identify the problem faster than before by providing extra context what went wrong. PR-URL: https://github.com/nodejs/node/pull/28263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01crypto: refactor array buffer view validationRuben Bridgewater
This is just a refactoring to reduce code and computational overhead. PR-URL: https://github.com/nodejs/node/pull/29683 Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-01console: update time formattingRuben Bridgewater
This improves the readability of the `console.timeEnd()` output while keeping a higher output's precision in multiple cases. Instead of e.g. '1.005min' it will print '1:00.300 (m:ss.mmm)'. PR-URL: https://github.com/nodejs/node/pull/29629 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-09-30src: rename --loader to --experimental-loaderAlex Aubuchon
Renames the `--loader` cli argument to `--experimental-loader`. This is to clearly indicate the esm loader feature as experimental even after esm is no longer experimental. Also minorly alters the `--experimental-loader` docs to say that the passed loader can be an esm module. Refs: https://github.com/nodejs/modules/issues/351#issuecomment-535189524 PR-URL: https://github.com/nodejs/node/pull/29752 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-09-30stream: always invoke callback before emitting errorRobert Nagy
Ensure the callback is always invoked before emitting the error in both sync and async case. PR-URL: https://github.com/nodejs/node/pull/29293 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>