0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

8068 Commits

Author SHA1 Message Date
Ben Noordhuis
0694401da3
crypto: generator must be int32 in DiffieHellman()
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>
2020-04-28 19:22:05 +02:00
Ben Noordhuis
6fdced46db
crypto: key size must be int32 in DiffieHellman()
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>
2020-04-28 19:22:02 +02:00
Santiago Gimeno
73324cf76a
cluster: fix error on worker disconnect/destroy
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>
2020-04-28 19:20:53 +02:00
rickyes
1d0b24924f
lib: fix validateport error message when allowZero is false
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>
2020-04-28 19:15:03 +02:00
Joyee Cheung
aa9708e479
v8: use AliasedBuffers for passing heap statistics around
Instead of holding shared pointers to ArrayBuffers, simplify
the code by using AliasedBuffers directly which allows the
binding to own the buffers.

PR-URL: https://github.com/nodejs/node/pull/32929
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-28 19:13:20 +02:00
thecodrr
d0377a825b
path: fix comment grammar
PR-URL: https://github.com/nodejs/node/pull/32942
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2020-04-28 19:10:26 +02:00
cjihrig
6ca6db105d
wasi: update start() behavior to match spec
_start() and _initialize() shouldn't be called from the same
function, as they have different behavior. Furthermore, Node
should throw if both are provided. This commit updates the
implementation, docs, and tests accordingly.

PR-URL: https://github.com/nodejs/node/pull/33073
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2020-04-28 13:04:43 -04:00
cjihrig
4791ea09bd
wasi: rename __wasi_unstable_reactor_start()
Upstream WASI has renamed __wasi_unstable_reactor_start() to
_initialize(). This commit updates Node's WASI implementation to
reflect that change.

PR-URL: https://github.com/nodejs/node/pull/33073
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2020-04-28 13:04:43 -04:00
himself65
9545013b52 vm: throw error when duplicated exportNames in SyntheticModule
Fixes: https://github.com/nodejs/node/issues/32806

PR-URL: https://github.com/nodejs/node/pull/32810
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-04-28 23:49:32 +08:00
Robert Nagy
f64c640e66 stream: don't emit end after close
Readable stream could emit 'end' after 'close'.

PR-URL: https://github.com/nodejs/node/pull/33076
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-28 16:00:44 +02:00
Robert Nagy
4bc7025309 stream: write should throw on unknown encoding
Validate encoding passed to write(chunk, encoding, cb) and
throw if it is invalid.

PR-URL: https://github.com/nodejs/node/pull/33075
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-28 15:59:46 +02:00
Myles Borins
2439071e18
module: refactor condition
PR-URL: https://github.com/nodejs/node/pull/32989
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-28 00:28:46 +02:00
Anna Henningsen
6068c72ae3
util,readline: NFC-normalize strings before getStringWidth
The assumption here is that decomposed characters render like their
composed character equivalents, and that working with the former
comes with a risk of over-estimating string widths given that
we compute them on a per-code-point basis. The regression test
added here (한글 vs 한글) is an example of that happening.

PR-URL: https://github.com/nodejs/node/pull/33052
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-27 19:45:05 +02:00
Anna Henningsen
38998d8538
module: do not warn when accessing __esModule of unfinished exports
Since this property access is performed by generated code, and not
used for accessing the actual exports of a module (and because
transpilers generally define it as the first key of `module.exports`
when it *is* present), it should be okay to allow it.

Refs: https://github.com/nodejs/node/pull/29935
Fixes: https://github.com/nodejs/node/issues/33046

PR-URL: https://github.com/nodejs/node/pull/33048
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-27 19:33:41 +02:00
Yash Ladha
b2768ae185
cluster: removed unused addressType argument from constructor
When intializing the constructor for cluster master we are heavily using
a generic structure, but the effect of passing arguments that are
related to shared_handle is that there is a stale argument passed.

We can avoid such scenarios as all the remaining entities are being
destructured from the message object.

PR-URL: https://github.com/nodejs/node/pull/32963
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-27 19:32:49 +02:00
Robert Nagy
c15a27cab3 stream: don't wait for close on legacy streams
Try to detect non standard streams and don't wait for
'close' on these. In particular if we detected
that destroyed is true before we expect it to be then
fallback to compat behavior.

Fixes: https://github.com/nodejs/node/issues/33050

PR-URL: https://github.com/nodejs/node/pull/33058
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-27 17:08:26 +02:00
Robert Nagy
f5c11a1a0a stream: don't emit finish after close
Writable stream could emit 'finish' after 'close'.

PR-URL: https://github.com/nodejs/node/pull/32933
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-27 16:43:58 +02:00
rickyes
58682d823a tls: add highWaterMark option for connect
PR-URL: https://github.com/nodejs/node/pull/32786
Fixes: https://github.com/nodejs/node/issues/32781
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-27 16:52:19 +03:00
Robert Nagy
ab7d9db36c stream: fix sync write perf regression
While https://github.com/nodejs/node/pull/31046 did make async
writes faster it at the same time made sync writes slower.

This PR corrects this while maintaining performance improvements.

PR-URL: https://github.com/nodejs/node/pull/33032
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-25 23:12:37 +02:00
Robert Nagy
003fb53c9a stream: avoid drain for sync streams
Previously a sync writable receiving chunks
larger than highwatermark would unecessarily
ping pong needDrain.

PR-URL: https://github.com/nodejs/node/pull/32887
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-25 18:45:50 +02:00
Gus Caplan
74c393dd93
vm: add importModuleDynamically option to compileFunction
Fixes: https://github.com/nodejs/node/issues/31860

PR-URL: https://github.com/nodejs/node/pull/32985
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-04-25 09:49:53 -05:00
Jesus Hernandez
24a4e6153d
stream: removes unnecessary params
Removes the state param in the onFinished function
since it's never used within it.

PR-URL: https://github.com/nodejs/node/pull/32936
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-25 02:37:26 +02:00
Yash Ladha
0d7638e2cc lib: unnecessary const assignment for class
PR-URL: https://github.com/nodejs/node/pull/32962
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-24 22:53:36 +03:00
Robert Nagy
802edb1d6a stream: consistent punctuation
Cleanup comments to use consistent punctuation.

PR-URL: https://github.com/nodejs/node/pull/32934
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-24 19:29:38 +02:00
himself65
d01a06a916 lib: simplify function process.emitWarning
PR-URL: https://github.com/nodejs/node/pull/32992
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@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>
2020-04-24 10:30:48 +03:00
Robert Nagy
d8c57cb3c0 stream: refactor Writable buffering
Refactors buffering in Writable to use an array
instead of a linked list.

PR-URL: https://github.com/nodejs/node/pull/31046
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-23 19:52:13 +02:00
Robert Nagy
6419e59889 stream: pipeline should only destroy un-finished streams
This PR logically reverts https://github.com/nodejs/node/pull/31940
which has caused lots of unnecessary breakage in the ecosystem.

This PR also aligns better with the actual documented behavior:

`stream.pipeline()` will call `stream.destroy(err)` on all streams
except:
  * `Readable` streams which have emitted `'end'` or `'close'`.
  * `Writable` streams which have emitted `'finish'` or `'close'`.

The behavior introduced in https://github.com/nodejs/node/pull/31940
was much more aggressive in terms of destroying streams. This was
good for avoiding potential resources leaks however breaks some
common assumputions in legacy streams.

Furthermore, it makes the code simpler and removes some hacks.

Fixes: https://github.com/nodejs/node/issues/32954
Fixes: https://github.com/nodejs/node/issues/32955

PR-URL: https://github.com/nodejs/node/pull/32968
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
2020-04-23 19:50:29 +02:00
Robert Nagy
4eb1701edb stream: finished should complete with read-only Duplex
If passed a Duplex where readable or writable has been
explicitly disabled then don't assume 'close' will be
emitted.

Fixes: https://github.com/nodejs/node/issues/32965

PR-URL: https://github.com/nodejs/node/pull/32967
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-04-23 19:47:11 +02:00
ConorDavenport
50d28d4b3a assert: port common.mustCall() to assert
Fixes: https://github.com/nodejs/node/issues/31392

PR-URL: https://github.com/nodejs/node/pull/31982
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-04-23 10:11:47 -07:00
daemon1024
1cc1ca4297 fs: update validateOffsetLengthRead in utils.js
PR-URL: https://github.com/nodejs/node/pull/32896
Fixes: https://github.com/nodejs/node/issues/32871
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-23 11:14:29 +03:00
bcoe
6a07eca49c
http2: wait for secureConnect before initializing
PR-URL: https://github.com/nodejs/node/pull/32958
Fixes: https://github.com/nodejs/node/issues/32922
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-22 18:22:46 -07:00
Guy Bedford
e767ed0558 module: exports not exported for null resolutions
PR-URL: https://github.com/nodejs/node/pull/32838
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2020-04-22 15:48:44 -07:00
Robert Nagy
ea87809bb6 stream: fix _final and 'prefinish' timing
This PR fixes a few different things:

The timing of 'prefinish' depends on whether or not
_final is defined. In on case the event is emitted
synchronously with end() and otherwise asynchronously.

_final is currently unecessarily called asynchronously
which forces implementors to use 'prefinish' as a hack
to emulate synchronous behaviour. Furthermore, this hack
is subtly broken due to the above issue.

Refs: https://github.com/nodejs/node/issues/31401
Refs: https://github.com/nodejs/node/pull/32763#discussion_r407041983

PR-URL: https://github.com/nodejs/node/pull/32780
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-22 09:40:03 +02:00
Myles Borins
09a50d3c5a
module: improve error for invalid package targets
For targets that are strings that do not start with `./` or `/` the
error will now have additional information about what the programming
error is.

Closes: https://github.com/nodejs/node/issues/32034

PR-URL: https://github.com/nodejs/node/pull/32052
Fixes: https://github.com/nodejs/node/issues/32034
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Signed-off-by: Myles Borins <myles.borins@gmail.com>
2020-04-21 21:48:14 -04:00
James M Snell
14aa313186
tls: move getAllowUnauthorized to internal/options
Make it so that the allow unauthorized warning can be easily reused
by the QUIC impl once that lands.

Extracted from https://github.com/nodejs/node/pull/32379

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32917
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-21 17:21:45 -07:00
rickyes
33a5cd5450 fs: extract kWriteFileMaxChunkSize constant
PR-URL: https://github.com/nodejs/node/pull/32640
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-04-20 20:16:05 +03:00
rickyes
f250adb28f perf_hooks: remove unnecessary assignment when name is undefined
PR-URL: https://github.com/nodejs/node/pull/32910
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-20 17:35:02 +03:00
Jesus Hernandez
a6a15fefb6 fs: remove unnecessary else statement
PR-URL: https://github.com/nodejs/node/pull/32662
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-04-19 07:58:44 +02:00
David Daza
83f7bb441f lib: remove unnecesary else block
The if statement inside the _writeHostObject function
returns an expression which makes the else block unnecessary.

PR-URL: https://github.com/nodejs/node/pull/32644
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-04-18 16:33:34 -05:00
Vadzim Zieńka
8a3fa32a1f stream: close iterator in Readable.from
Call iterator.return() if not all of its values are consumed.

Fixes: https://github.com/nodejs/node/issues/32842

PR-URL: https://github.com/nodejs/node/pull/32844
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-18 21:28:17 +02:00
Robert Nagy
fd10be4b54 stream: inline unbuffered _write
PR-URL: https://github.com/nodejs/node/pull/32886
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-04-18 21:10:40 +02:00
Robert Nagy
73f3072ffb stream: simplify Writable.end()
Simplifies Writable.end() by inlining and
de-duplicating code.

PR-URL: https://github.com/nodejs/node/pull/32882
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-18 21:07:26 +02:00
Guy Bedford
22b6997aba
module: remove experimental modules warning
PR-URL: https://github.com/nodejs/node/pull/31974
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-04-17 12:26:12 -04:00
Qinhui Chen
6bcf968401 module: fix memory leak when require error occurs
Delete useless module in parent module: parent.children array
when error occurs, so that it can be garbage collected.

Fixes: https://github.com/nodejs/node/issues/32836

PR-URL: https://github.com/nodejs/node/pull/32837
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-17 12:35:00 +03:00
Robert Nagy
4a6a5c3453 stream: improve comments regarding end() errors
Cleans up comments and TODOs and tries to provide a
more detail description in regards to error behavior
of end().

PR-URL: https://github.com/nodejs/node/pull/32839
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-16 09:29:42 +02:00
Robert Nagy
15cc2b652b stream: update comment to indicate unused API
destroy w/ callback was previously used by node
core. This is no longer the case and the
comments should reflect this to avoid confusion.

PR-URL: https://github.com/nodejs/node/pull/32808
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-16 09:26:50 +02:00
Robert Nagy
0bd5595509 stream: simplify Transform stream implementation
Significantly simplified Transform stream implementation by
using mostly standard stream code.

PR-URL: https://github.com/nodejs/node/pull/32763
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-15 21:25:42 +02:00
Robert Nagy
a495a5ea4a fs: use finished over destroy w/ cb
destroy w/ is undocumented API which also will cause
a race if the stream is already destroying and potentially
invoking the callback too early and withou error.

PR-URL: https://github.com/nodejs/node/pull/32809
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-04-15 14:39:20 +02:00
Robert Nagy
613d4217e8
http: refactor agent 'free' handler
Remove nesting in favor of early returns.

PR-URL: https://github.com/nodejs/node/pull/32801
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-15 02:13:51 +02:00
Anna Henningsen
907ebdd76d
process: suggest --trace-warnings when printing warning
Suggest using `--trace-warnings` or `--trace-deprecation` the first
time a warning is emitted without a stack trace, similar to how
we suggest `--trace-uncaught` when printing uncaught exceptions
without a stack trace.

PR-URL: https://github.com/nodejs/node/pull/32797
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-04-15 02:10:53 +02:00
Yash Ladha
55b4d030ef lib: created isValidCallback helper
check for callback function is moved to a separate function.
This piece of code is being shared by other entities as well.

PR-URL: https://github.com/nodejs/node/pull/32665
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-14 13:54:21 +08:00
Gerhard Stoebich
aa34465ae3 buffer: add type check in bidirectionalIndexOf
Add a type check in bidirectionalIndexOf to avoid using something else
as Buffer. This may happen if e.g. lastIndexOf is called with invalid
this.

PR-URL: https://github.com/nodejs/node/pull/32770
Fixes: https://github.com/nodejs/node/issues/32753
Fixes: https://github.com/nodejs/node/issues/32747
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-04-13 23:22:09 +02:00
unknown
1211b9a72f
util: change default value of maxStringLength to 10000
Refs: https://github.com/nodejs/node/pull/32392

PR-URL: https://github.com/nodejs/node/pull/32744
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-04-13 19:46:35 +02:00
Anna Henningsen
1f9761f4cc
tls: provide default cipher list from command line
Avoid storing data that depends on command line options on internal
bindings. This is generally a cleaner way of accessing CLI options.

PR-URL: https://github.com/nodejs/node/pull/32760
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-04-13 18:48:23 +02:00
Anna Henningsen
bb5e7097e8
buffer: mark pool ArrayBuffer as untransferable
This removes a footgun in which users could attempt to transfer the
pooled ArrayBuffer underlying a regular `Buffer`, which would lead to
all `Buffer`s that share the same pool being rendered unusable as well,
and potentially break creation of new pooled `Buffer`s.

This disables this kind of transfer.

Refs: https://github.com/nodejs/node/issues/32752

PR-URL: https://github.com/nodejs/node/pull/32759
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-13 18:47:27 +02:00
Andrey Pechkurov
50dd63e8ef
async_hooks: merge run and exit methods
PR-URL: https://github.com/nodejs/node/pull/31950
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-13 18:37:44 +02:00
Stephen Belanger
f7f0441997
async_hooks: prevent sync methods of async storage exiting outer context
PR-URL: https://github.com/nodejs/node/pull/31950
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-13 18:37:09 +02:00
龙腾道
4439009d65 lib: fix return type of setTimeout in net.Socket
Function setTimeout in net.Socket should return this,
not undefined, as doc said.

PR-URL: https://github.com/nodejs/node/pull/32722
Refs: https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-04-11 12:22:12 +08:00
himself65
d0a3bf1f11 perf_hooks: allow omitted parameters in 'performance.measure'
Make `startMark` and `endMark` parameters optional.

PR-URL: https://github.com/nodejs/node/pull/32651
Fixes: https://github.com/nodejs/node/issues/32647
Refs: https://www.w3.org/TR/user-timing-2/#measure-method
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-10 18:08:30 +08:00
Jesus Hernandez
4076e043b8 lib: removes unnecessary params
PR-URL: https://github.com/nodejs/node/pull/32694
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-10 16:47:21 +08:00
unknown
944d8626b3
util: add maxStrLength option to inspect function
Refs: https://github.com/nodejs/node/issues/25478

PR-URL: https://github.com/nodejs/node/pull/32392
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-08 18:02:54 +02:00
Yash Ladha
6faa162f55
lib: changed functional logic in cluster schedulers
Free pool in round_robin scheduler is implemented as an array. There
were constant lookups being for distributing load on other workers in
free pool. Reimplementing in Map will create will be more performant as
compared to Array implementation. This was done for all in past but free
wasn't implemented at that time.

PR-URL: https://github.com/nodejs/node/pull/32505
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-04-07 20:36:20 +02:00
rickyes
6779331831
dns: remove duplicate code
PR-URL: https://github.com/nodejs/node/pull/32664
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-07 20:35:07 +02:00
rickyes
1c816f0c59
async_hooks: use hasHooks function internally
PR-URL: https://github.com/nodejs/node/pull/32656
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-07 20:27:45 +02:00
Robert Nagy
98b6b2d840 stream: complete pipeline with stdio
stdio (stderr & stdout) should for compatibility
reasons not be closed/end():ed. However, this
causes pipeline with a stdio destination to
never finish. This commit fixes this issue at
a performance cost.

Refs: https://github.com/nodejs/node/issues/7606

Fixes: https://github.com/nodejs/node/issues/32363

PR-URL: https://github.com/nodejs/node/pull/32373
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-06 21:48:25 +02:00
Andrey Pechkurov
561dda273f async_hooks: move to lazy destroy hook registration in AsyncResource
PR-URL: https://github.com/nodejs/node/pull/32429
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
2020-04-06 16:14:43 +02:00
Robert Nagy
8f86986985 stream: use callback to properly propagate error
The stream will be destroyed upstream through the proper error
flow.

PR-URL: https://github.com/nodejs/node/pull/29179
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-03 19:00:28 +02:00
Jan Krems
9129ab1996
module: expose exports conditions to loaders
PR-URL: https://github.com/nodejs/node/pull/31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-04-03 01:29:39 +02:00
Juan José Arboleda
ff2f47d786
worker: support MessagePort to workers data
PR-URL: https://github.com/nodejs/node/pull/32278
Fixes: https://github.com/nodejs/node/issues/32250
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-03 01:12:19 +02:00
Robert Nagy
efefdd668d net: autoDestroy Socket
Refactors net.Socket into using autoDestroy functionality
of streams.

PR-URL: https://github.com/nodejs/node/pull/31806
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-04-02 23:38:32 +02:00
Ruben Bridgewater
6baddcfddf
util: only inspect error properties that are not visible otherwise
Inspecting errors results in duplicated information in case an error
is created with enumerable `name`, `message` or `stack` properties.
In that case, check if the output already contains that information
and prevent listing that property.

This reduces the noise as receiver.

PR-URL: https://github.com/nodejs/node/pull/32327
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2020-04-02 18:41:57 +02:00
Lucas Holmquist
88b4e86fd7
fs: make parameters optional for readSync
This makes the offset, length and position parameters optional by
passing in an options object.

PR-URL: https://github.com/nodejs/node/pull/32460
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-02 18:34:31 +02:00
Alex R
b149eefa82 http: fix incorrect headersTimeout measurement
For keep-alive connections, the headersTimeout may fire during
subsequent request because the measurement was reset after
a request and not before a request.

PR-URL: https://github.com/nodejs/node/pull/32329
Fixes: https://github.com/nodejs/node/issues/27363
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-02 14:50:20 +02:00
Robert Nagy
138eb32be1 net: wait for shutdown to complete before closing
When not allowing half open, handle.close would be
invoked before shutdown has been called and
completed causing a potential data race.

Fixes: https://github.com/nodejs/node/issues/32486#issuecomment-604072559

PR-URL: https://github.com/nodejs/node/pull/32491
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-01 13:05:10 +02:00
Guy Bedford
534c204e22 module: path-only CJS exports extension searching
PR-URL: https://github.com/nodejs/node/pull/32351
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-03-31 20:39:01 -06:00
Denys Otrishko
fd7e5d40a4
wasi: clean up options validation
PR-URL: https://github.com/nodejs/node/pull/31797
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-30 17:22:22 +02:00
murgatroid99
18c3ff99aa
dns: add dns.ALL hints flag constant
PR-URL: https://github.com/nodejs/node/pull/32183
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 17:21:13 +02:00
himself65
defbc2ed82
fs: fix fs.read when passing null value
PR-URL: https://github.com/nodejs/node/pull/32479
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2020-03-30 17:10:25 +02:00
Yash Ladha
a5e81e72b6
lib: removed unused error code
PR-URL: https://github.com/nodejs/node/pull/32481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-30 10:26:30 +02:00
Saajan
4fc13b016a
stream: change var to let/const in stream files
PR-URL: https://github.com/nodejs/node/pull/32214
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-30 10:25:41 +02:00
Robert Nagy
2bf02285a3
http: move free socket error handling to agent
The http client should not know anything about free sockets. Let
the agent handle its pool of sockets.

PR-URL: https://github.com/nodejs/node/pull/32003
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-03-30 10:25:03 +02:00
himself65
1bbd679adc
lib: replace Array to ArrayIsArray by primordials
PR-URL: https://github.com/nodejs/node/pull/32258
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:22:52 +02:00
Robert Nagy
e034f5c3d9
http: don't emit 'readable' after 'close'
PR-URL: https://github.com/nodejs/node/pull/32277
Refs: https://github.com/nodejs/node/issues/28710
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 10:22:11 +02:00
Sk Sajidul Kadir
97ef4d76c9
fs: add fs.readv()
Fixes: https://github.com/nodejs/node/issues/2298
PR-URL: https://github.com/nodejs/node/pull/32356
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 10:18:58 +02:00
Gus Caplan
89ae1f1b73
util: fix inspecting document.all
Fixes: https://github.com/nodejs/node/issues/31889

PR-URL: https://github.com/nodejs/node/pull/31938
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-03-30 10:17:08 +02:00
James M Snell
05aa67aa21
console: fixup error message
Use "options.inspectOptions" instead of just "inspectOptions"

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32475
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-28 14:37:32 +01:00
James M Snell
7d3791a3a4
fs: fixup error message for invalid options.recursive
Use "options.recursive" instead of just "recursive"

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32472
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-28 14:36:27 +01:00
James M Snell
ca19d553cf
http: fixup options.method error message
Use `options.method` instead of just `method`

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32471
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-27 16:01:24 +01:00
James M Snell
a0578714bf
repl: fixup error message
Use "cmd.action" instead of just "action" for ERR_INVALID_ARG_TYPE

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32474
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-27 15:59:43 +01:00
Robert Nagy
1428a92492
stream: make pipeline try to wait for 'close'
Pipeline uses eos which will invoke the callback
on 'finish' and 'end' before all streams have been
fully destroyed.

Fixes: https://github.com/nodejs/node/issues/32032

PR-URL: https://github.com/nodejs/node/pull/32158
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-27 15:55:21 +01:00
Robert Nagy
0d0f151a46
stream: emit 'pause' on unpipe
unpipe should use pause() instead of mutating
state.flowing directly so that pausing side
effects such as emitting 'pause' are properly
performed.

Fixes: https://github.com/nodejs/node/issues/32470

PR-URL: https://github.com/nodejs/node/pull/32476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-03-26 14:48:18 -04:00
Robert Nagy
388cef61e8 stream: align stream.Duplex with net.Socket
stream.Duplex and net.Socket slightly differs in behavior.

Especially when it comes to the case where one side never
becomes readable or writable. This aligns Duplex with the
behavior of Socket.

PR-URL: https://github.com/nodejs/node/pull/32139
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-25 15:20:22 +01:00
Robert Nagy
05f1df5200 stream: fix pipeline with dest in objectMode
pipeline did not support destination with generator
that does not return strings or buffers.

PR-URL: https://github.com/nodejs/node/pull/32414
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-25 14:46:10 +01:00
Robert Nagy
eeccd52b4e net: make readable/writable start as true
`net.Socket` is slightly breaking stream invariants by
having readable/writable going from `false` to `true`.
Streams assume that readable/writable starts out `true`
and then goes to `false` through `push(null)`/`end()`
after which it never goes back to `true`, e.g. once a
stream is `writable == false` it is assumed it will
never become `true`.

This PR changes 2 things:

Unless explicitly set to `false` through options:

- starts as `readable`/`writable` `true` by default.
- uses `push(null)`/`end()` to set `readable`/`writable`
  to `false`. Note that this would cause the socket to
  emit the `'end'`/`'finish'` events, which it did not
  do previously.

In the case it is explicitly set to `false` through
options` it is assumed to never become `true`.

PR-URL: https://github.com/nodejs/node/pull/32272
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-24 09:45:25 +01:00
Jan Krems
07a1fb953e module: add hook for global preload code
PR-URL: https://github.com/nodejs/node/pull/32068
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-03-23 08:39:37 -05:00
Robert Nagy
a9401439c7 zlib: align with streams
- Ensure automatic destruction only happens after both
'end' and 'finish' has been emitted through autoDestroy.
- Ensure close() callback is always invoked.
- Ensure 'error' is only emitted once.

PR-URL: https://github.com/nodejs/node/pull/32220
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-03-19 10:56:45 +01:00
Michaël Zasso
9b6e797379
Revert "assert: fix line number calculation after V8 upgrade"
This reverts commit 5981fb7faa.

PR-URL: https://github.com/nodejs/node/pull/32116
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-03-18 16:35:41 -07:00
Robert Nagy
a9270dcbeb http: don't emit 'finish' after 'error'
PR-URL: https://github.com/nodejs/node/pull/32276
Refs: https://github.com/nodejs/node/issues/28710
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-18 13:09:26 +01:00
cjihrig
c788964a75 errors: drop pronouns from ERR_WORKER_PATH message
This commit drops pronouns from the ERR_WORKER_PATH message,
and also shortens the text a bit.

PR-URL: https://github.com/nodejs/node/pull/32285
Refs: https://github.com/nodejs/node/pull/31664
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-17 13:27:16 -07:00
Sam Roberts
8cbbc70fbc src,cli: support compact (one-line) JSON reports
Multi-line JSON is more human readable, but harder for log aggregators
to consume, they usually require a log message per line, particularly
for JSON. Compact output will be consumable by aggregators such as EFK
(Elastic Search-Fluentd-Kibana), LogDNA, DataDog, etc.

PR-URL: https://github.com/nodejs/node/pull/32254
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-03-17 08:42:41 -07:00