0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

7870 Commits

Author SHA1 Message Date
James M Snell
d3715c76b5 http: move OutboundMessage.prototype.flush to EOL
API was deprecated long ago. Move to end of life and remove.

PR-URL: https://github.com/nodejs/node/pull/31164
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-02-24 08:46:37 -08:00
Robert Nagy
db28739aed stream: fix broken pipeline error propagation
If the destination was an async function any
error thrown from that function would be swallowed.

PR-URL: https://github.com/nodejs/node/pull/31835
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-24 12:20:49 +01:00
vdeturckheim
9c702922cd
async_hooks: introduce async-context API
Adding AsyncLocalStorage class to async_hooks
 module.
This API provide a simple CLS-like set
of features.

Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/26540
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-02-23 20:24:02 +01:00
simon
341c06f088 tls: expose SSL_export_keying_material
Fixes: https://github.com/nodejs/node/issues/31802

PR-URL: https://github.com/nodejs/node/pull/31814
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-02-23 01:21:04 -04:00
Robert Nagy
21bd6679ce stream: fix finished typo
https://github.com/nodejs/node/pull/31509 introduced a slight typo.
Fortunately this typo does not have big impact due to
`isWritableFinished()`.

Fixes: https://github.com/nodejs/node/pull/31509#discussion_r381809355

PR-URL: https://github.com/nodejs/node/pull/31881
Fixes: https://github.com/nodejs/node/issues/31509
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-22 10:39:18 +01:00
Harshitha KP
2d3717ad84
worker: emit runtime error on loop creation failure
Instead of hard asserting throw a runtime error,
that is more consumable.

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

PR-URL: https://github.com/nodejs/node/pull/31621
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-19 19:54:59 +01:00
Gus Caplan
b8e41774d4
fs: add fs/promises alias module
PR-URL: https://github.com/nodejs/node/pull/31553
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2020-02-18 22:15:50 -08:00
Robert Nagy
8ba7a2f889 http2: make compat finished match http/1
finished should true directly after end().

PR-URL: https://github.com/nodejs/node/pull/24347
Refs: https://github.com/nodejs/node/issues/24743
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-18 20:54:31 +01:00
Guy Bedford
58de9b46b8 module: package "exports" error refinements
PR-URL: https://github.com/nodejs/node/pull/31625
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2020-02-18 13:34:40 +02:00
Robert Nagy
85c6fcd1cd stream: avoid writing to writable
A remainder from a previous refactoring.

Refs: https://github.com/nodejs/node/pull/31197

PR-URL: https://github.com/nodejs/node/pull/31805
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-17 23:31:08 +01:00
Anna Henningsen
26e49d8332
worker: unroll file extension regexp
Refs: https://github.com/nodejs/node/pull/31662#discussion_r377016190

PR-URL: https://github.com/nodejs/node/pull/31779
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-16 16:56:59 +01:00
Robert Nagy
568fdfb165 fs: fix WriteStream autoClose order
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.

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

PR-URL: https://github.com/nodejs/node/pull/31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-16 14:33:20 +01:00
Robert Nagy
c776a37791 http: end with data can cause write after end
Calling end() with data while ending should trigger
a write after end error.

PR-URL: https://github.com/nodejs/node/pull/28666
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-16 10:22:17 +01:00
legendecas
75311dbc2f
async_hooks: ensure event after been emitted on runInAsyncScope
The exception handler user-defined will not automatically emit after
for the async resource.

Also removes a duplicated case
`test-emit-after-uncaught-exception-runInAsyncScope.js`
which is identical to test-emit-after-uncaught-exception.js.

Refs: https://github.com/nodejs/node/pull/30965
PR-URL: https://github.com/nodejs/node/pull/31784
Fixes: https://github.com/nodejs/node/issues/31783
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-14 16:55:02 +01:00
Robert Nagy
0c7ff7fcfb stream: simplify Writable.write
Slightly refactors Writable.write for minor perf
and readability improvements.

PR-URL: https://github.com/nodejs/node/pull/31146
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-02-14 14:29:46 +01:00
Robert Nagy
0875837417 stream: fix async iterator destroyed error order
There was an edge case where if _destroy calls the error callback
later than one tick the iterator would complete early and not
propgate the error.

PR-URL: https://github.com/nodejs/node/pull/31314
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/31700
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-14 08:44:05 +01:00
Robert Nagy
9cbf6af5b5 crypto: fix performance regression
e559842188
made writable/readable computed with a legacy mode if the properties
are written to.

LazyTransform still unecessarily wrote to these properties causing a
performance regression.

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

PR-URL: https://github.com/nodejs/node/pull/31742
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-13 22:50:56 +01:00
Antoine du HAMEL
611a158f1a
worker: add support for .cjs extension
PR-URL: https://github.com/nodejs/node/pull/31662
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-13 21:32:01 +01:00
Robert Nagy
b9a7625fdf
stream: removed outdated TODO
Was resolved in e559842188.

PR-URL: https://github.com/nodejs/node/pull/31701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-13 21:20:19 +01:00
Denys Otrishko
bc55b57e64
lib: fix few comment typos in fs/watchers.js
PR-URL: https://github.com/nodejs/node/pull/31705
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-13 21:19:23 +01:00
Rich Trott
a18b437e6a
util: throw if unreachable TypedArray checking code is reached
If a comparison code path that is supposed to be unreachable is reached,
throw. Add a c8 comment to ignore coverage for the line, as it
should be unreachable.

PR-URL: https://github.com/nodejs/node/pull/31737
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-13 21:04:21 +01:00
Denys Otrishko
d63bcdd9cd
worker: properly handle env and NODE_OPTIONS in workers
PR-URL: https://github.com/nodejs/node/pull/31711
Fixes: https://github.com/nodejs/node/issues/30627
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-02-13 16:05:27 +01:00
ZYSzys
3e9302b2b3 fs: validate the input data before opening file
PR-URL: https://github.com/nodejs/node/pull/31731
Refs: https://github.com/nodejs/node/pull/31030
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-13 21:34:29 +08:00
Rich Trott
3eba33eb07 util: throw if unreachable code is reached
If a comparison code path that is supposed to be unreachable is reached,
throw. Add a c8 comment to ignore coverage for the line, as it should be
unreachable.

PR-URL: https://github.com/nodejs/node/pull/31712
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-02-11 13:34:51 -10:00
Matteo Collina
9fdb6e6aaf
async_hooks: add executionAsyncResource
Remove the need for the destroy hook in the basic APM case.

Co-authored-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/node/pull/30959
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-11 20:59:09 +01:00
Denys Otrishko
2abf0afb2b
vm: refactor value validation with internal/validators.js
PR-URL: https://github.com/nodejs/node/pull/31480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2020-02-10 21:41:00 +02:00
Denys Otrishko
c405e9b23c
lib: improve value validation utils
Add common validators: `validateArray`, `validateBoolean`,
`validateObject` and appropriate tests.

PR-URL: https://github.com/nodejs/node/pull/31480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2020-02-10 21:40:41 +02:00
antsmartian
0ac04ecee2
stream: combine properties using defineProperties
PR-URL: https://github.com/nodejs/node/pull/31187
Refs: https://github.com/nodejs/node/pull/31144
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-10 16:58:05 +01:00
cjihrig
efec6811b6
readline: remove intermediate variable
This commit removes an extrea intermediate variable. This
makes the call consistent with other uses of validateUint32()
in the codebase.

PR-URL: https://github.com/nodejs/node/pull/31676
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-09 11:06:07 -05:00
Ruben Bridgewater
63f10b9f0d
tty: do not end in an infinite warning recursion
It was possible that this warning ends up in an infinite recursion.
The reason is that printing the warning triggered a color check and
that triggered another warning. Limiting it to a single warning
prevents this.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-09 13:39:56 +01:00
Ruben Bridgewater
36f328e21f
assert: align character indicators properly
This makes sure color codes are not taken into account in case
util.inspect's default value was changed.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-09 13:39:54 +01:00
Brian White
74291e4a7b
buffer: improve from() performance
PR-URL: https://github.com/nodejs/node/pull/31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-08 21:40:49 -05:00
Brian White
43783b5b3f
stream: improve writable.write() performance
PR-URL: https://github.com/nodejs/node/pull/31624
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-08 21:36:31 -05:00
Robert Nagy
d016b9d708 stream: finished callback for closed streams
Previously finished(stream, cb) would not invoke the callback
for streams that have already finished, ended or errored
before being passed to finished(stream, cb).

PR-URL: https://github.com/nodejs/node/pull/31509
Refs: https://github.com/nodejs/node/pull/31508
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-08 23:34:40 +01:00
Robert Nagy
e559842188 stream: make readable & writable computed
This makes readable and writable automatically computed based
on the stream state.

Effectivly deprecating/discouraging manual management of this.

Makes the properties  more consistent and easier to reason about.

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

PR-URL: https://github.com/nodejs/node/pull/31197
Refs: https://github.com/nodejs/node/issues/29377
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-08 23:23:12 +01:00
Rich Trott
8c18e91c8a process: remove undocumented now argument from emitWarning()
process.emitWarning() "now" option is undocumented and a Boolean trap.
Remove it before people start adopting it.

We only need it in one place internally. Replace it with an
internal-only emitWarningSync() function.

PR-URL: https://github.com/nodejs/node/pull/31643
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-02-07 15:37:36 -10:00
Anna Henningsen
a555be2e45 worker: improve MessagePort performance
Use a JS function as the single entry point for emitting `.onmessage()`
calls, avoiding the overhead of manually constructing each message
event object in C++.

                                                                             confidence improvement accuracy (*)   (**)  (***)
    worker/echo.js n=100000 sendsPerBroadcast=1 payload='object' workers=1         ***     16.34 %       ±1.16% ±1.54% ±1.99%
    worker/echo.js n=100000 sendsPerBroadcast=1 payload='string' workers=1         ***     24.41 %       ±1.50% ±1.99% ±2.58%
    worker/echo.js n=100000 sendsPerBroadcast=10 payload='object' workers=1        ***     26.66 %       ±1.54% ±2.05% ±2.65%
    worker/echo.js n=100000 sendsPerBroadcast=10 payload='string' workers=1        ***     32.72 %       ±1.60% ±2.11% ±2.73%
    worker/messageport.js n=1000000 payload='object'                               ***     40.28 %       ±1.48% ±1.95% ±2.52%
    worker/messageport.js n=1000000 payload='string'                               ***     76.95 %       ±2.19% ±2.90% ±3.75%

Also fix handling exceptions returned from `MessagePort::New`.

PR-URL: https://github.com/nodejs/node/pull/31605
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-07 11:01:59 -10:00
Ruben Bridgewater
f9a27ea510
readline: make tab size configurable
This adds the `tabSize` option to readline to allow different tab
sizes.

PR-URL: https://github.com/nodejs/node/pull/31318
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-07 12:38:04 +01:00
James M Snell
ab4115f17c
os: move tmpDir() to EOL
The tmpDir alias was deprecated in 7.0.0

PR-URL: https://github.com/nodejs/node/pull/31169
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-02-05 17:50:42 -08:00
James M Snell
ec0dd6fa1c
lib: move GLOBAL and root aliases to EOL
GLOBAL and root have been long deprecated.

PR-URL: https://github.com/nodejs/node/pull/31167
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-02-05 17:48:08 -08:00
James M Snell
bffa5044c5
crypto: move pbkdf2 without digest to EOL
API has been being incrementally deprecated since 6.0.0

PR-URL: https://github.com/nodejs/node/pull/31166
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-02-05 17:41:19 -08:00
James M Snell
907c07fa85
stream: move _writableState.buffer to EOL
API was deprecated back in the 0.11 days.

PR-URL: https://github.com/nodejs/node/pull/31165
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-02-05 17:35:56 -08:00
Robert Nagy
234de6f1fd
stream: fix finished w/ 'close' before 'finish'
Emitting 'close' before 'finish' on a Writable should
result in a premature close error.

PR-URL: https://github.com/nodejs/node/pull/31534
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-05 15:48:54 +01:00
Ruben Bridgewater
fb6df3bfac
fs: validate the input data to be of expected types
The input was not validated so far and that caused unwanted side
effects. E.g., `undefined` became the string `'undefined'`. It was
expected to fail or to end up as empty string.
Now all input is validated to be either some type of array buffer
view or a string. That way it's always clear what the user intents.

PR-URL: https://github.com/nodejs/node/pull/31030
Fixes: https://github.com/nodejs/node/issues/31025
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-02-05 13:39:53 +01:00
Rusty Conover
ee9e689df2 net: track state of setNoDelay() and prevent unnecessary system calls
The state of .setNoDelay() is now tracked and code will prevent repeated
system calls to setsockopt() when the value has already been set to the
desired value for the socket.

Change and expand the appropriate test.

PR-URL: https://github.com/nodejs/node/pull/31543
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-03 15:15:24 -08:00
Guy Bedford
0f96dc266f esm: import.meta.resolve with nodejs: builtins
PR-URL: https://github.com/nodejs/node/pull/31032
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-02-03 18:31:02 +02:00
Anna Henningsen
875a4d1a58 worker: add ability to take heap snapshot from parent thread
PR-URL: https://github.com/nodejs/node/pull/31569
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-03 07:04:13 -08:00
bcoe
13fe56bbbb
fs: return first folder made by mkdir recursive
mkdir('/foo/bar', { recursive: true }) and mkdirSync will now return
the path of the first folder created. This matches more closely
mkdirp's behavior, and is useful for setting folder permissions.

PR-URL: https://github.com/nodejs/node/pull/31530
Refs: https://github.com/nodejs/node/issues/31481
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 11:57:19 -08:00
Anna Henningsen
abe6a2e3d1 process: report ArrayBuffer memory in memoryUsage()
Report memory allocations performed by the `ArrayBuffer::Allocator`.

PR-URL: https://github.com/nodejs/node/pull/31550
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-01-30 16:34:03 -08:00
Matteo Collina
2cd9892425 Revert "stream: fix async iterator destroyed error propagation"
This reverts commit d15b8ea3bd.

PR-URL: https://github.com/nodejs/node/pull/31508
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-01-28 22:22:19 -08:00