Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v15.5.0 release proposal #36597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
v15.5.0 release proposal #36597
Changes from 1 commit
9852ebc040b39fdeaafd56a6b3af166aa8ad3d1f33023291b169406b8ecf2f93341b2c02afe58210390f2a60e3b31b062d5929b0804f166326f8ccf7542a3be331de2dd705ade46a46a6ecbc1d129053f1330995e5978824f3d7bbe2ced0df368d690f749a3c6e65d00baa610e23309462bfe3de44957113d6597cc544db30fe0ff58319d5acd78d9989181156fe9ba96c095f21fbcb65ff7f42f7635fd1b4984dfa40366d299cee1ec851620ecc8225a2454584ea8b22f03939f2d3c2728f512d8b5b9468687d3109ab787a34452c3ec90d81e603bcb4652ef09985deb29a167b8d373b0393fa752c94d1f43aad27fb651309e2975b49807b6a31f07efb31125d7e90397e31e4b81d79f11a64860b5e6936b4ddd213dcd79830fe5c6700ad27260c7ad75c78149f2cf9fc247995c80f53f33d0b7c903ecbbc0d14e1f00fdf3828c90d4d347dc8d1a7c5602fbe3c5adce30af7b5481be8a1ba6689fbab3e82a2626036ed1f19c2332d38a0ec22ac227ecbb75701576fbf978628File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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: #36343 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing