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

1903 Commits

Author SHA1 Message Date
ZYSzys
6ba9471f6f http2: use the latest settings
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-02 14:53:42 -07:00
Lucas Holmquist
83418b593f doc: add documentation deprecation for process._tickCallback
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-02 14:34:55 -07:00
Ruben Bridgewater
eb05d68815
crypto: refactor array buffer view validation
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-01 22:39:37 +02:00
Ruben Bridgewater
204248a0c3
console: update time formatting
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-10-01 21:13:53 +02:00
Alex Aubuchon
15fb02a515 src: rename --loader to --experimental-loader
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-30 21:47:01 -07:00
Robert Nagy
f663b31cc2 stream: always invoke callback before emitting error
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>
2019-09-30 10:56:29 -07:00
Guy Bedford
c42ab995c1 module: pass full URL to loader for top-level load
PR-URL: https://github.com/nodejs/node/pull/29736
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-09-29 20:12:24 -07:00
Robert Nagy
ce62e963a1 stream: remove ambiguous code
PR-URL: https://github.com/nodejs/node/pull/29664
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-09-29 18:42:55 +09:00
Guy Bedford
2825e1183d module: move cjs type check behind flag
PR-URL: https://github.com/nodejs/node/pull/29732
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-09-28 11:56:39 -07:00
Richard Lau
95792a7989 Revert "stream: invoke callback before emitting error always"
This reverts commit 3de5eae6db.

PR-URL: https://github.com/nodejs/node/pull/29741
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-09-28 06:53:52 -07:00
Ruben Bridgewater
aea9a0f77d worker: fix process._fatalException return type
This makes sure `process._fatalException()` returns a boolean when
run inside of a worker.

PR-URL: https://github.com/nodejs/node/pull/29706
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-09-27 16:26:42 -07:00
Robert Nagy
3de5eae6db stream: invoke callback before emitting error always
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>
2019-09-27 15:45:17 -07:00
rickyes
322e1e15d5 http2: optimize the altsvc Max bytes limit, define and use constants
PR-URL: https://github.com/nodejs/node/pull/29673
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: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-25 22:31:37 -07:00
Tobias Nießen
61743063cc crypto: use byteLength in timingSafeEqual
PR-URL: https://github.com/nodejs/node/pull/29657
Co-authored-by: ZaneHannanAU <ZaneHannanAU@users.noreply.github.com>
Co-authored-by: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-09-25 15:58:15 -03:00
Ruben Bridgewater
1fa403762c console,util: fix missing recursion end while inspecting prototypes
This makes sure prototypes won't be inspected infinitely for some
obscure object creations. The depth is now taken into account and
the recursion ends when the depth limit is reached.

PR-URL: https://github.com/nodejs/node/pull/29647
Fixes: https://github.com/nodejs/node/issues/29646
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-09-23 23:42:10 -07:00
Chetan Karande
fed05cc414 stream: cleanup use of internal ended state
PR-URL: https://github.com/nodejs/node/pull/29645
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-09-24 06:42:56 +02:00
Shobhit Chittora
fdd5d4ad4a
bootstrap: add exception handling for profiler bootstrap
Add exception handling for the case when profile is
not bootstrapped when coverage is enabled.

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

PR-URL: https://github.com/nodejs/node/pull/29552
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-09-23 12:04:20 +02:00
Robert Nagy
95d6ad67bf fs: remove unnecessary argument check
Writable already assures that only Buffer's are passed to _write. Also
this is not the "correct" way to handle errors inside _write.

PR-URL: https://github.com/nodejs/node/pull/29043
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-09-22 16:23:02 -07:00
Jeremiah Senkpiel
a861b84d5d timers: set _destroyed even if there are no destroy-hooks
Required for other potential changes.

This should make it so we can always just check _destroyed to
check if a timer has been ended.

PR-URL: https://github.com/nodejs/node/pull/29595
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-09-22 16:19:26 -07:00
Robert Nagy
ec390b63a1 stream: do not call _read() after destroy()
PR-URL: https://github.com/nodejs/node/pull/29491
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-09-22 15:55:15 -07:00
Robert Nagy
8709a408d2 stream: use more accurate end-of-stream writable and readable detection
The value of stream.readable and stream.writable should not
be used to detect whether a stream is Writable or Readable.

Refs: https://github.com/nodejs/node/issues/29395
PR-URL: https://github.com/nodejs/node/pull/29409
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-22 15:47:40 -07:00
Gus Caplan
8235ffd786
console: skip/strip %c formatting
Fixes: https://github.com/nodejs/node/issues/29605
Refs: https://console.spec.whatwg.org
PR-URL: https://github.com/nodejs/node/pull/29606
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-09-22 00:42:22 +02:00
Benjamin Coe
8f06773a8c
process: initial SourceMap support via NODE_V8_COVERAGE
PR-URL: https://github.com/nodejs/node/pull/28960
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-09-22 00:39:41 +02:00
Guy Bedford
4396bebfe1 module: error for CJS .js load within type: module
PR-URL: https://github.com/nodejs/node/pull/29492
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2019-09-19 15:24:50 -07:00
Gus Caplan
1ec4154e50
src: re-delete Atomics.wake
PR-URL: https://github.com/nodejs/node/pull/29586
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-09-18 16:09:20 -05:00
Jeremiah Senkpiel
4d798e1b1b bootstrap: provide usable error on missing internal module
Due to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.

That resulted in the following unhelpful error if an internal module
was missing or misnamed:

```
internal/bootstrap/loaders.js:190
  return mod.compile();
             ^

TypeError: Cannot read property 'compile' of undefined
```

This changes that to at least print the id that was attempted to be
loaded:

```
internal/bootstrap/loaders.js:189
  if (!mod) throw new TypeError(`Missing internal module '${id}'`);
            ^

TypeError: Missing internal module 'internal/a'
```

PR-URL: https://github.com/nodejs/node/pull/29593
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-09-18 08:18:38 -07:00
Guy Bedford
3f3ad38c87 module: reintroduce package exports dot main
This reintroduces the dot main in exports as discussed in the previous
Node.js modules meeting.

The implementation includes both CommonJS and ES module resolution with
the associated documentation and resolver specification changes.

In addition to the dot main, "exports" as a string or direct fallback
array is supported as well.

Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/29494
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2019-09-17 18:54:44 -07:00
Eugene Ostroukhov
3d841fe20d inspector: new API - Session.connectToMainThread
This API is designed to enable worker threads use Inspector protocol
on main thread (and other workers through NodeWorker domain).

Note that worker can cause dead lock by suspending itself. I will
work on a new API that will allow workers to be hidden from the
inspector.

Fixes: https://github.com/nodejs/node/issues/28828
PR-URL: https://github.com/nodejs/node/pull/28870
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-09-16 09:01:55 -07:00
Aditya
70abb4ffe4 tty: add color support for mosh
PR-URL: https://github.com/nodejs/node/pull/27843
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-09-15 21:54:58 -07:00
Chetan Karande
ddd72eccfe process: use public readableFlowing property
PR-URL: https://github.com/nodejs/node/pull/29502
Refs: https://github.com/nodejs/node/issues/445
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-09-14 16:12:37 +08:00
Anna Henningsen
7c9ee6dd88
util: add encodeInto to TextEncoder
Add function encodeInto to TextEncoder, and add MessageChannel
to the encodeInto.any.js test.

Fixes: https://github.com/nodejs/node/issues/28851
Fixes: https://github.com/nodejs/node/issues/26904
Refs: https://github.com/nodejs/node/pull/28862
Co-authored-by: AtticusYang <yyongtai@163.com>

PR-URL: https://github.com/nodejs/node/pull/29524
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-13 20:27:18 +02:00
Tobias Nießen
b64446648b
crypto: add oaepLabel option
The label acts as the "L" input to the RSA-OAEP algorithm.

PR-URL: https://github.com/nodejs/node/pull/29489
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-13 16:58:41 +02:00
Anna Henningsen
2833a0d8b7
worker: make terminate() resolve for unref’ed Workers
Once `worker.terminate()` is called, the Worker instance will be
destroyed as soon as possible anyway, so in order to make
the Promise returned by `worker.terminate()` resolve always,
it should be okay to just call `.ref()` on it and keep the main
event loop alive temporarily.

PR-URL: https://github.com/nodejs/node/pull/29484
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-09-09 22:21:37 +02:00
Anna Henningsen
e585caa2be http2: do not crash on stream listener removal w/ destroyed session
Do not crash when the session is no longer available.

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

PR-URL: https://github.com/nodejs/node/pull/29459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-09-07 21:15:24 -07:00
Bradley Farias
6ce87c027d policy: minor perf opts and cleanup
PR-URL: https://github.com/nodejs/node/pull/29322
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-03 11:12:05 -05:00
Robert Nagy
b03845b937 stream: make finished call the callback if the stream is closed
Make stream.finished callback invoked if stream is already
closed/destroyed.

PR-URL: https://github.com/nodejs/node/pull/28748
Reviewed-By: Matteo Collina <matteo.collina@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>
2019-09-03 10:28:48 +02:00
Anna Henningsen
ab841d5fba lib: add ASCII fast path to getStringWidth()
A lot of strings that are going to be passed to `getStringWidth()`
are ASCII strings, for which the calculation is rather easy and
calling into C++ can be skipped.

                                                       confidence improvement accuracy (*)    (**)   (***)
     misc/getstringwidth.js n=100000 type='ascii'            ***    328.99 %      ±21.73% ±29.25% ±38.77%
     misc/getstringwidth.js n=100000 type='emojiseq'                  2.94 %       ±7.66% ±10.19% ±13.26%
     misc/getstringwidth.js n=100000 type='fullwidth'                 4.70 %       ±5.64%  ±7.50%  ±9.76%

PR-URL: https://github.com/nodejs/node/pull/29301
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.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: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-09-02 21:02:34 -07:00
Robert Nagy
897587c013 stream: don't deadlock on aborted stream
Not all streams (e.g. http.ClientRequest) will always emit
'close' after 'aborted'.

PR-URL: https://github.com/nodejs/node/pull/29376
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-09-02 16:31:33 +02:00
Anna Henningsen
9e23eeffd0 console: use getStringWidth() for character width calculation
This is more accurate for displayed full-width characters
(e.g. CJK ones) and makes the calculations match the ones we
use in the readline module.

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

PR-URL: https://github.com/nodejs/node/pull/29300
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-02 11:43:58 +05:30
Brian White
98b718572f
stream: improve read() performance
PR-URL: https://github.com/nodejs/node/pull/29337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2019-08-30 23:39:26 -04:00
Anna Henningsen
a194eacc96 util: do not throw when inspecting detached ArrayBuffer
PR-URL: https://github.com/nodejs/node/pull/29318
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>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2019-08-29 05:52:05 +02:00
Brian White
34961c7b5f
process: improve nextTick performance
PR-URL: https://github.com/nodejs/node/pull/25461
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-08-27 22:14:15 -04:00
cjihrig
c246f813f8 errors: provide defaults for unmapped uv errors
libuv does not map 100% of errors. When an unmapped error is
encountered, the Map returns undefined, which is then
unsuccessfully destructured, causing an exception. This commit
adds a default value in the event of an unmapped error.

PR-URL: https://github.com/nodejs/node/pull/29288
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-08-27 11:27:33 -07:00
cjihrig
627bf59e8d lib: consolidate lazyErrmapGet()
There are currently two implementations of this function.
This commit removes the redundancy, and removes "lazy" from
the name.

PR-URL: https://github.com/nodejs/node/pull/29285
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-08-25 16:10:07 -07:00
Xavier Stouder
66043e1812
console: display timeEnd with suitable time unit
When timeEnd function is called, display result with a suitable
time unit instead of a big amount of milliseconds.

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

PR-URL: https://github.com/nodejs/node/pull/29251
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-08-25 16:39:18 +02:00
Maledong
d5c3837061 lib: remove the comment of base64 validation
Since there's a comment about the 'base64' validation needed, and this
will result in a breaking change, so this should be removed.

PR-URL: https://github.com/nodejs/node/pull/29201
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-08-24 10:41:58 +05:30
Robert Nagy
033037cec9 stream: avoid unecessary nextTick
If we are not going to emit 'close' then there is no reason to
schedule it.

PR-URL: https://github.com/nodejs/node/pull/29194
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-23 15:23:09 -07:00
Brian White
8292b280ec
net: allow reading data into a static buffer
Co-Authored-By: Anna Henningsen <anna@addaleax.net>

PR-URL: https://github.com/nodejs/node/pull/25436
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-08-23 17:05:52 -04:00
cjihrig
53816cce69 fs: add recursive option to rmdir()
This commit adds a recursive option to fs.rmdir(),
fs.rmdirSync(), and fs.promises.rmdir(). The implementation
is a port of the npm module rimraf.

PR-URL: https://github.com/nodejs/node/pull/29168
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-08-23 13:59:07 -07:00
Robert Nagy
4e188b3c63 stream: async iterator destroy compat
async iterator should not depend on internal API for better compat
with streamlike objects.

PR-URL: https://github.com/nodejs/node/pull/29176
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-23 08:58:10 +02:00