You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change makes realms other than the main one support modules by
having a module map associated to each realm, rather than one per
module. As part of this, it also:
- Adds an argument to `JsRuntime::create_realm` to set the realm's
module loader. This allows different realms to have different module
loading strategies (different import maps, for example).
- Moves all of the methods of `JsRuntime` related to module loading
into `JsRealm`. To minimize changing unrelated code, the public and
crate-private methods in `JsRuntime` are kept, with their
implementation replaced by a call to the corresponding method of the
main realm's `JsRealm`.
- Removes the `module_map` argument to the `EventLoopPendingState`
constructor, instead accessing each realm's corresponding module map
as part of the existing iteration.
- Changes the parts of `JsRuntime::poll_event_loop` that deal with
module evaluation and detecting stalled top-level awaits to support
multiple module maps and multiple top-level module evaluations at
the same time.
- Moves `pending_mod_evaluate` and `pending_dyn_mod_evaluate` from
`JsRuntimeState` to `ContextState`.
Towards #13239.
0 commit comments