- Dec 14, 2020
-
-
Anna Henningsen authored
Fall back to using the outer context’s microtask queue, rather than the Isolate’s default one. This would otherwise result in surprising behavior if an embedder specified a custom microtask queue for the main Node.js context. PR-URL: https://github.com/nodejs/node/pull/36482 Refs: https://github.com/v8/v8/commit/4bf051d536a172e7932845d82f918ad7280c7873 Reviewed-By:
Gus Caplan <me@gus.host> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Anna Henningsen authored
Original commit message: [api] Add Context::GetMicrotaskQueue method Add a method that returns the microtask queue that is being used by the `v8::Context`. This is helpful in non-monolithic embedders like Node.js, which accept Contexts created by its own embedders like Electron, or for native Node.js addons. In particular, it enables: 1. Making sure that “nested” `Context`s use the correct microtask queue, i.e. the one from the outer Context. 2. Enqueueing microtasks into the correct microtask queue. Previously, these things only worked when the microtask queue for a given Context was the Isolate’s default queue. As an alternative, I considered adding a way to make new `Context`s inherit the queue from the `Context` that was entered at the time of their creation, but that seemed a bit more “magic”, less flexible, and didn’t take care of concern 2 listed above. Change-Id: I15ed796df90f23c97a545a8e1b30a3bf4a5c4320 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2579914 Reviewed-by:Toon Verwaest <verwaest@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#71710} Refs: https://github.com/v8/v8/commit/4bf051d536a172e7932845d82f918ad7280c7873 PR-URL: https://github.com/nodejs/node/pull/36482 Reviewed-By:
Gus Caplan <me@gus.host> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
- Dec 13, 2020
-
-
Anna Henningsen authored
Add a way to get the current `IsolateData*` and, from it, the current Node.js `ArrayBufferAllocator` if there is one. This can be useful for re-using either one of these structures as an embedder. PR-URL: https://github.com/nodejs/node/pull/36441 Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
Richard Lau <rlau@redhat.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Anna Henningsen authored
Otherwise `TriggerUncaughtException()` → `PrintException()` → `GetErrorSource()` can crash. PR-URL: https://github.com/nodejs/node/pull/36414 Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Shelley Vohr <codebytere@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Anna Henningsen authored
This addresses the `TODO` left on my request in 9e446b3e. :) Refs: https://github.com/nodejs/node/pull/36271 PR-URL: https://github.com/nodejs/node/pull/36345 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Rich Trott authored
PR-URL: https://github.com/nodejs/node/pull/36448 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Shelley Vohr <codebytere@gmail.com>
-
Shelley Vohr authored
PR-URL: https://github.com/nodejs/node/pull/36451 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
Alba Mendez authored
We have a few places where we individually forward each parameter to tls.createSecureContext(). In #28973 and others, we added new SecureContext options but forgot to keep these places up to date. As per https.Agent#getName, I understand that at least `privateKeyIdentifier` and `privateKeyEngine` should be added too, since they're a substitute for `key`. I've also added sigalgs. Fixes: https://github.com/nodejs/node/issues/36322 Refs: https://github.com/nodejs/node/pull/28973 PR-URL: https://github.com/nodejs/node/pull/36416 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Darcy Clarke authored
PR-URL: https://github.com/nodejs/node/pull/36487 Reviewed-By:
Myles Borins <myles.borins@gmail.com> Reviewed-By:
Ruy Adorno <ruyadorno@github.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Ruben Bridgewater authored
Signed-off-by:
Ruben Bridgewater <ruben@bridgewater.de> Fixes: https://github.com/nodejs/node/issues/35730 PR-URL: https://github.com/nodejs/node/pull/36178 Fixes: https://github.com/nodejs/node/issues/36151 Refs: https://github.com/nodejs/node/pull/35754 Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Guy Bedford <guybedford@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Ruben Bridgewater authored
Signed-off-by:
Ruben Bridgewater <ruben@bridgewater.de> Fixes: https://github.com/nodejs/node/issues/36151 PR-URL: https://github.com/nodejs/node/pull/36178 Fixes: https://github.com/nodejs/node/issues/35730 Refs: https://github.com/nodejs/node/pull/35754 Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Guy Bedford <guybedford@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Benjamin Gruenbaum authored
PR-URL: https://github.com/nodejs/node/pull/36432 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
- Dec 12, 2020
-
-
kai zhu authored
PR-URL: https://github.com/nodejs/node/pull/36361 Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Mary Marchini <oss@mmarchini.me> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Shelley Vohr authored
Node.js sets a stack trace handler specific to the v8::Context corresponding to the current Environment. When Electron is running in a non-Node.js v8::Context (e.g in the renderer process with contextIsolation enabled), there will be no correspondent Environment - we therefore need to prevent this handler being set so that Blink falls back to its default handling and displays the correct stacktrace. PR-URL: https://github.com/nodejs/node/pull/36447 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Gus Caplan <me@gus.host> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Ruy Adorno authored
PR-URL: https://github.com/nodejs/node/pull/36459 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Myles Borins <myles.borins@gmail.com>
-
Myles Borins authored
Refs: https://github.com/nodejs/node/pull/36473 Refs: https://github.com/advisories/GHSA-qqgx-2p2h-9c37 PR-URL: https://github.com/nodejs/node/pull/36474 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com>
-
- Dec 11, 2020
-
-
ZauberNerd authored
This test proves that the PerformanceObserver callback gets called with the async context of the callsite of performance.mark()/measure() and therefore AsyncLocalStorage can be used inside a PerformanceObserver. PR: https://github.com/nodejs/node/pull/36343 PR-URL: https://github.com/nodejs/node/pull/36343 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Nicolai Stange authored
This reverts commit 009e4182. AFAIU the discussion at [1], PerformanceObserver had been made to inherit from AsyncResource more or less as a band-aid in lack of a better async_context candidate to invoke it in. In order to enable access to AsyncLocalStores from PerformanceObservers invoked synchronously through e.g. measure() or mark(), the current async_context, if any, should be retained. Note that this is a breaking change, but - as has been commented at [1], PerformanceObserver being derived from AsyncResource is a "minor divergence from the spec" anyway, - to my knowledge this is an internal implementation detail which has never been documented and - I can't think of a good reason why existing PerformanceObserver implementations would possibly rely on it. OTOH, it's probably worthwhile to not potentially invoke before() and after() async_hooks for each and every PerformanceObserver notification. [1] https://github.com/nodejs/node/pull/18789 Co-Authored-By:
ZauberNerd <zaubernerd@zaubernerd.de> PR-URL: https://github.com/nodejs/node/pull/36343 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Nicolai Stange authored
It's desirable to retain async_contexts active at callsites of perf_hooks.performance.mark() and alike in the subsequent PerformanceObserver invocations such that the latter can access e.g. associated AsyncLocalStorage instances. In working towards this goal replace the node::MakeCallback(..., async_context{0, 0}) in PerformanceEntry::doNotify() by the new node::MakeSyncCallback() introduced specifically for this purpose. This change will retain the original async_context, if any, in perf_hook's observersCallback() and thus, for the subsequent doNotify() on unbuffered PerformanceObservers. Co-Authored-By:ZauberNerd <zaubernerd@zaubernerd.de> PR-URL: https://github.com/nodejs/node/pull/36343 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Nicolai Stange authored
There are situations where one wants to invoke a JS callback's ->Call() from C++ and in particular retain any existing async_context state, but where it's not obvious that a plain ->Call() would be safe at the point in question. Such callsites usually resort to node::MakeCallback(..., async_context{0, 0}), which unconditionally pushes the async_context{0, 0} and takes the required provisions for the ->Call() itself such as triggering the tick after its return, if needed. An example would be the PerformanceObserver invocation from PerformanceEntry::Notify(): this can get called when coming from JS through e.g. perf_hooks.performance.mark() and alike, but perhaps also from nghttp2 (c.f. EmitStatistics() in node_http2.cc). In the former case, a plain ->Call() would be safe and it would be desirable to retain the current async_context so that PerformanceObservers can access it resp. the associated AsyncLocalStorage. However, in the second case the additional provisions taken by node::MakeCallback() might potentially be strictly required. So PerformanceEntry::Notify() bites the bullet and invokes the PerformanceObservers through node::MakeCallback() unconditionally, thereby always rendering any possibly preexisting async_context inaccessible. Introduce the convenience node::MakeSyncCallback() for such usecases, which would basically forward to ->Call() if safe and to node::MakeCallback(..., async_context{0, 0}) otherwise. Co-Authored-By:ZauberNerd <zaubernerd@zaubernerd.de> PR-URL: https://github.com/nodejs/node/pull/36343 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Daniel Bevenius authored
This commit adds a typedef for the callback parameter used in CleanupHookCallback's constructor, AddCleanupHook, and RemoveCleanupHook. PR-URL: https://github.com/nodejs/node/pull/36442 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Michaël Zasso authored
PR-URL: https://github.com/nodejs/node/pull/36406 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Michael Dawson <midawson@redhat.com>
-
Michael Dawson authored
Signed-off-by:
Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/36475 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Benjamin Gruenbaum authored
PR-URL: https://github.com/nodejs/node/pull/36431 Reviewed-By:
Robert Nagy <ronagy@icloud.com> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com>
-
Antoine du Hamel authored
PR-URL: https://github.com/nodejs/node/pull/36356 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com>
-
- Dec 10, 2020
-
-
Moshe vilner authored
Verify that if something different than Abortcontroller.signal is passed to child_process.execFile(), ERR_INVALID_ARG_TYPE is thrown. PR-URL: https://github.com/nodejs/node/pull/36429 Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Rich Trott authored
PR-URL: https://github.com/nodejs/node/pull/36436 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
Richard Lau authored
PR-URL: https://github.com/nodejs/node/pull/36460 Refs: https://github.com/nodejs/node/commit/348b7a9606da61fbb5437e27f479363114ecf4eb#r44957158 Refs: https://github.com/nodejs/node/pull/36385 Reviewed-By:
Beth Griggs <bgriggs@redhat.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Gus Caplan <me@gus.host> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Danielle Adams <adamzdanielle@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Myles Borins <myles.borins@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <midawson@redhat.com>
-
cjihrig authored
This rule is new in ESLint 7.15.0. PR-URL: https://github.com/nodejs/node/pull/36411 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com>
-
cjihrig authored
Update ESLint to 7.15.0 PR-URL: https://github.com/nodejs/node/pull/36411 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com>
-
- Dec 09, 2020
-
-
raisinten authored
I would like to apply for the role of a triager in this project. My motivation to become a triager is to help with the issues in this repo and the help repo, as well as learn deeper internals of Node.js, and to eventually become a collaborator! I hearby declare that I have read and understood the Code of Conduct of the project and will adhere to that. PR-URL: https://github.com/nodejs/node/pull/36404 Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Ruy Adorno authored
PR-URL: https://github.com/nodejs/node/pull/36395 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Myles Borins <myles.borins@gmail.com>
-
Danielle Adams authored
PR-URL: https://github.com/nodejs/node/pull/36435 Notable changes: * child_processes: * add AbortSignal support (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36308) * deps: * update ICU to 68.1 (Michaël Zasso) (https://github.com/nodejs/node/pull/36187) * events: * support signal in EventTarget (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36258) * graduate Event, EventTarget, AbortController (James M Snell) (https://github.com/nodejs/node/pull/35949) * http: * enable call chaining with setHeader() (pooja d.p) (https://github.com/nodejs/node/pull/35924) * module: * add isPreloading indicator (James M Snell) (https://github.com/nodejs/node/pull/36263) * stream: * support abort signal (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36061) * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (https://github.com/nodejs/node/pull/35922) * worker: * add experimental BroadcastChannel (James M Snell) (https://github.com/nodejs/node/pull/36271)
-
Rich Trott authored
The timeout is insufficient in CI (failures on Raspberry Pi) and I can reproduce locally (on macOS) with `tools/test.py -j 96 --repeat 192 test-repl`. Increase timeout drastically as it only is useful in an error condition. PR-URL: https://github.com/nodejs/node/pull/36415 Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Daniel Bevenius authored
PR-URL: https://github.com/nodejs/node/pull/36425 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
Daniel Bevenius authored
This commit removes one of the V macros in IsolateData::MemoryInfo as they are identical as far as I can tell. PR-URL: https://github.com/nodejs/node/pull/36427 Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Richard Lau <rlau@redhat.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Zeyu Yang <himself65@outlook.com>
-
Daniel Bevenius authored
PR-URL: https://github.com/nodejs/node/pull/36365 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Richard Lau <rlau@redhat.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Benjamin Gruenbaum authored
We added an `AbortError` with the same code and name as the web's as part of the consensus in https://github.com/nodejs/node/issues/36084 but never actually documented the error in our error codes list. This PR adds the error code. PR-URL: https://github.com/nodejs/node/pull/36319 Reviewed-By:
Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Michaël Zasso authored
PR-URL: https://github.com/nodejs/node/pull/36407 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Myles Borins <myles.borins@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
- Dec 08, 2020
-
-
Anna Henningsen authored
Add scopes that ensure that the context associated with the current Environment is always entered when working with it. PR-URL: https://github.com/nodejs/node/pull/36413 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Gus Caplan <me@gus.host> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-