1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

LibJS+LibWeb: More bringing module loading closer to spec

In particular, this patch removes three host hooks on JS::VM in favor
of the new JS-side module loading stuff.
This commit is contained in:
Andreas Kling 2023-12-02 22:56:47 +01:00
parent 07f567cd9f
commit 8b7d27b349
15 changed files with 234 additions and 319 deletions

View file

@ -234,8 +234,9 @@ ThrowCompletionOr<Value> shadow_realm_import_value(VM& vm, DeprecatedString spec
TRY(vm.push_execution_context(eval_context, {}));
// 6. Let referrer be the Realm component of evalContext.
// 7. Perform HostImportModuleDynamically(referrer, specifierString, innerCapability).
MUST_OR_THROW_OOM(vm.host_import_module_dynamically(NonnullGCPtr { *eval_context.realm }, ModuleRequest { move(specifier_string) }, inner_capability));
auto referrer = JS::NonnullGCPtr { *eval_context.realm };
// 7. Perform HostLoadImportedModule(referrer, specifierString, empty, innerCapability).
vm.host_load_imported_module(referrer, ModuleRequest { specifier_string }, nullptr, inner_capability);
// 7. Suspend evalContext and remove it from the execution context stack.
// NOTE: We don't support this concept yet.