This is a continuation of https://github.com/nodejs/node/pull/29434,
rewriting the last remaining call to RunMicrotasks.
PR-URL: https://github.com/nodejs/node/pull/29581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
When implementing _writev, _write should be optional.
PR-URL: https://github.com/nodejs/node/pull/29639
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
We have special logic in removeListener() which must apply
to off() as well.
PR-URL: https://github.com/nodejs/node/pull/29486
Reviewed-By: Benjamin Gruenbaum <benjamingr@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>
While V8 itself should not have any remaining tasks on the queue
during platform shutdown, our inspector implementation may do so.
Thus, the checks verifying that no tasks are queued at that point
make some of the inspector tasks flaky.
Remove the checks and replace them by explicitly destroying all
tasks that are left.
Refs: https://github.com/nodejs/node/pull/25653
Refs: https://github.com/nodejs/node/pull/28870#issuecomment-531908090
PR-URL: https://github.com/nodejs/node/pull/29587
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
In `.end()` methods, an optional `encoding` parameter makes sense
only if the `data` (`chunk`) parameter is provided.
PR-URL: https://github.com/nodejs/node/pull/29615
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Indented assignment in a Makefile can be interpreted
as a command in e.g. GNU Make 3.81 which results in the
following error:
```
make: CPPLINT_QUIET: No such file or directory
```
PR-URL: https://github.com/nodejs/node/pull/29623
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
It doesn't make much sense to flush a stream which has been destroyed.
PR-URL: https://github.com/nodejs/node/pull/29028
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
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>
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>
Original commit message:
[debugger] Fix code coverage for break/return inside switch-case
Case statements have a list of statements associated with them, but are
not blocks, and were hence not fixed-up correctly for code coverage.
This CL also applies the fix-up to the "body" of case statements,
in this way removing ranges reported as uncovered between the final
break/return in a case and the next case (or end of function).
Drive-by: Add optional pretty printing to code coverage test results.
Change-Id: I5f4002d4e17b7253ed516d99f7c389ab2264be10
Bug: v8:9705
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1798426
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63719}
Refs: deac757bc7
PR-URL: https://github.com/nodejs/node/pull/29626
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Remove the legacy `http_parser` implementation as a dependency
and all code that uses it in favor of llhttp, given that the latter
has been the default for all of Node 12 with no outstanding issues.
PR-URL: https://github.com/nodejs/node/pull/29589
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
After 'error' only 'close' should be emitted.
PR-URL: https://github.com/nodejs/node/pull/28979
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: https://github.com/nodejs/node/pull/29535
This PR replaces the instances of var with let/const.
PR-URL: https://github.com/nodejs/node/pull/29575
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This allows us to remove OS-dependent code.
confidence improvement accuracy (*) (**) (***)
process/bench-env.js operation='delete' n=1000000 3.57 % ±10.86% ±14.46% ±18.85%
process/bench-env.js operation='enumerate' n=1000000 *** -14.06 % ±7.46% ±9.94% ±12.96%
process/bench-env.js operation='get' n=1000000 -7.97 % ±11.80% ±15.70% ±20.45%
process/bench-env.js operation='query' n=1000000 -1.32 % ±8.38% ±11.17% ±14.58%
process/bench-env.js operation='set' n=1000000 -0.98 % ±9.63% ±12.81% ±16.68%
The drop in enumeration performance is likely due to the large
number of extra allocations that libuv performs. However, enumerating
process.env should generally not be a hot path in most applications.
PR-URL: https://github.com/nodejs/node/pull/29188
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Benchmark different types of operations and make results comparable
by normalizing process.env for enumeartion.
PR-URL: https://github.com/nodejs/node/pull/29188
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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>
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>
my legal name changed, so i'm removing lingering references
to my old name from the Internet.
PR-URL: https://github.com/nodejs/node/pull/29597
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
A new version of remark-preset-lint-node adds linting for unordered list
style.
PR-URL: https://github.com/nodejs/node/pull/29594
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
To confirm with upcoming markdown lint rule, use `*` for unordered
lists.
PR-URL: https://github.com/nodejs/node/pull/29594
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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>