diff options
author | Andreu Botella <andreu@andreubotella.com> | 2023-01-14 19:39:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 09:09:00 +0530 |
commit | 05ef925eb095ae603f694fe8172ddcbd5b19b9b2 (patch) | |
tree | f4cd7fe88a62f5f427c2dba77f9902b13abaf501 /ext/fetch/23_request.js | |
parent | df8bfa26be69af46b8f166e255330b5ba8d48893 (diff) |
refactor(core): Move optional callbacks from `JsRuntimeState` to `ContextState` (#17422)
The `JsRuntimeState` struct stores a number of JS callbacks that are
used either in the event loop or when interacting with V8. Some of these
callback fields are vectors of callbacks, and therefore could plausibly
store at least one callback per realm. However, some of those fields are
`Option<v8::Global<v8::Function>>`, which would make the callbacks set
by a realm override the one that might have been set by a different
realm.
As it turns out, all of the current such optional callbacks
(`js_promise_reject_cb`, `js_format_exception_cb` and
`js_wasm_streaming_cb`) are only used from inside a realm, and therefore
this change makes it so such callbacks can only be set from inside a
realm, and will only affect that realm.
This is a reland of #15599.
Towards #13239.
Diffstat (limited to 'ext/fetch/23_request.js')
0 files changed, 0 insertions, 0 deletions