PR-URL: https://github.com/nodejs/node/pull/20782
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Use a new public V8 API for inspecting weak collections and
collection iterators, rather than using V8-internal functions
to achieve this. This currently comes with a slight modification of
the output for inspecting iterators generated by `Set().entries()`.
Fixes: https://github.com/nodejs/node/issues/20409
PR-URL: https://github.com/nodejs/node/pull/20719
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Original commit message:
[api] Expose PreviewEntries as public API
Turn `debug::EntriesPreview` into a public API.
This is a straightforward approach to addressing
nodejs/node#20409
(not relying on functionality behind `--allow-natives-syntax`)
in Node.js.
Refs: ff0a979333
PR-URL: https://github.com/nodejs/node/pull/20719
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add support for metadata events. At this point they are added to the
main buffer. Emit a metadata event for the main thread.
PR-URL: https://github.com/nodejs/node/pull/20757
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Current description seems to suggest that only one linked-module can be
provided. This modifies the example to show that multiple
inked-modules can be used.
PR-URL: https://github.com/nodejs/node/pull/20774
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
a 'merge' command has recently been added to nyc, eliminating the need
for the istanbul-merge library.
PR-URL: https://github.com/nodejs/node/pull/20760
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Update to remark-lint-prohibited-strings 1.0.3 to avoid false positives
with GitHub team names which must be lowercased no matter what our
prohibited-strings rules say about a particular string.
PR-URL: https://github.com/nodejs/node/pull/20742
Refs: https://github.com/nodejs/node/pull/20740
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The input for `assert.deepStrictEqual` and similar expect the actual
input first and the expected input as second argument. This verifies
that this is actually done correct in our tests.
This is important so the possible error message actually makes sense.
PR-URL: https://github.com/nodejs/node/pull/20718
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
According to the console.table documentation, it reads that it "falls
back to just logging the argument if it can’t be parsed as tabular."
But it doesn't fall back when I give a function as its first argument.
It logs an empty table. This is fixes by this commit.
PR-URL: https://github.com/nodejs/node/pull/20681
Fixes: https://github.com/nodejs/node/issues/20679
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In the document for fs, there are several functions that state "No
arguments other than a possible exception are given to the completion
callback." (ex> fs.access, fs.chmod, fs.close, ..)
But, the functions are invoking the callback with two parameters (err,
undefined)
It causes problems in using several API like
[async.waterfall](https://caolan.github.io/async/docs.html#waterfall).
PR-URL: https://github.com/nodejs/node/pull/20629
Fixes: https://github.com/nodejs/node/issues/20335
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Imitate python repl, when the user enters 'exit' or 'quit',
no longer prompt 'Reference Error', but
prompts 'To exit, press ^D or type .exit'.
If the user defines variables named 'exit' or 'quit' ,
only the value of the variables are output
PR-URL: https://github.com/nodejs/node/pull/20617
Fixes: https://github.com/nodejs/node/issues/19021
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This makes sure there is no regression by switching to loading
eagerly.
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
The call to url was not necessary since the `url` module itself was
already taking care of this.
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This makes sure the async hooks and more is only loaded in case it
is actually necessary.
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
The array was only used to create a key. Instead of allocating that
first, just directly create the necessary string.
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Introduce `URL_FLAGS_IS_DEFAULT_SCHEME_PORT` flag which is retured
when the parser detects that the port passed is the default port
for that scheme.
PR-URL: https://github.com/nodejs/node/pull/20479
Fixes: https://github.com/nodejs/node/issues/20465
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit aims to reduce some code duplication in state.js
PR-URL: https://github.com/nodejs/node/pull/20415
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
cp.exec decide to use `_stdout`(_stdout is string) or
`Buffer.concat(_stdout)`(_stdout is buffer array) by options.encoding.
but std(out|err) encoding can be changed. If encoding is changed to
not null, `_stdout` will become string, and `Buffer.concat(_stdout)`
will throw TypeError. This patch will fix it, use
options.encoding and `std(out|err)._readableState.encoding`.
PR-URL: https://github.com/nodejs/node/pull/18976
Fixes: https://github.com/nodejs/node/issues/18969
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Upstream deprecated them and moved them into categories of their own.
Add those categories to the export list. Node.js doesn't use them but
some add-ons do.
Fixes: https://github.com/nodejs/node/issues/20369
PR-URL: https://github.com/nodejs/node/pull/20712
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias NieÃen <tniessen@tnie.de>
Currently the following compiler warnings are generated:
../src/node_zlib.cc:222:8:
warning: 'DoThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void DoThreadPoolWork() {
^
../src/node_internals.h:509:16: note: overridden virtual function is here
virtual void DoThreadPoolWork() = 0;
^
../src/node_zlib.cc:357:8: warning:
'AfterThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void AfterThreadPoolWork(int status) {
^
../src/node_internals.h:510:16:
note: overridden virtual function is here
virtual void AfterThreadPoolWork(int status) = 0;
^
This commit adds the override specifier to the methods to silence the
warnings.
PR-URL: https://github.com/nodejs/node/pull/20769
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/20785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This change adds a new inspector domain for receiving Node tracing
data.
1. Node.js now can extend Inspector protocol with new domains with
the API defined in the src/inspector/node_protocol.pdl.
2. Plumbing code will be generated at the build time. /json/protocol
HTTP endpoint returns both V8 and Node.js inspector protocol.
3. "NodeTracing" domain was introduced. It is based on the Chrome
"Tracing" domain.
PR-URL: https://github.com/nodejs/node/pull/20608
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Original commit message:
Custom tag for the traceEvents array
This API will be used by Node.js to provide output compatible with
Chrome devtools.
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I265495f8af39bfc78d7fdbe43ac308f0920e817d
Reviewed-on: https://chromium-review.googlesource.com/1044491
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53041}
PR-URL: https://github.com/nodejs/node/pull/20608
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
The references in the COLLABORATOR_GUIDE appear to be in no particular
order. Sort in ASCII order.
PR-URL: https://github.com/nodejs/node/pull/20790
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Original commit message:
ThreadDataTable: Change global linked list to per-Isolate hash map.
For use cases with a large number of threads or a large number of
isolates (or both), ThreadDataTable can be a major performance
bottleneck due to O(n) lookup time of the linked list. Switching to a
hash map reduces this to O(1).
Example 1: Sandstorm.io, a Node.js app that utilizes "fibers", was
observed spending the majority of CPU time iterating over the
ThreadDataTable.
See: https://sandstorm.io/news/2016-09-30-fiber-bomb-debugging-story
Example 2: Cloudflare's Workers engine, a high-multi-tenancy web
server framework built on V8 (but not Node), creates large numbers of
threads and isolates per-process. It saw a 34x improvement in
throughput when we applied this patch.
Cloudflare has been using a patch in production since the Worker
launch which replaces the linked list with a hash map -- but still
global.
This commit builds on that but goes further and creates a separate
hash map and mutex for each isolate, with the table being a member of
the Isolate class. This avoids any globals and should reduce lock
contention.
Bug: v8:5338
Change-Id: If0d11509afb2e043b888c376e36d3463db931b47
Reviewed-on: https://chromium-review.googlesource.com/1014407
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52753}
PR-URL: https://github.com/nodejs/node/pull/20727
Ref: https://github.com/nodejs/node/issues/20083
Refs: https://github.com/nodejs/node/issues/20083
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>