diff options
author | Andreu Botella <andreu@andreubotella.com> | 2022-09-01 23:01:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 23:01:05 +0200 |
commit | 307d84cfa5c1489ddfc8477f6561676356399e8c (patch) | |
tree | 5a65bdf5a3be832ee26852461b087552a552d22d /core/01_core.js | |
parent | 58e76098e6325ad16d552924d58c33bad6573c07 (diff) |
refactor(core): Move optional callbacks from `JsRuntimeState` to `ContextState` (#15599)
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.
Diffstat (limited to 'core/01_core.js')
0 files changed, 0 insertions, 0 deletions