diff --git a/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp b/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp index 82f1e9565cf..353f69af22b 100644 --- a/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp +++ b/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp @@ -40,7 +40,6 @@ ThrowCompletionOr ShadowRealmConstructor::call() } // 3.2.1 ShadowRealm ( ), https://tc39.es/proposal-shadowrealm/#sec-shadowrealm -// https://github.com/tc39/proposal-shadowrealm/pull/410 ThrowCompletionOr> ShadowRealmConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); @@ -62,7 +61,7 @@ ThrowCompletionOr> ShadowRealmConstructor::construct(FunctionObj // 8. Set O.[[ShadowRealm]] to realmRec. object->set_shadow_realm(realm_record); - // 9. Perform ? HostInitializeShadowRealm(realmRec). + // 9. Perform ? HostInitializeShadowRealm(realmRec, innerContext, O). TRY(vm.host_initialize_shadow_realm(realm_record, move(inner_context), object)); // 10. Return O. diff --git a/Libraries/LibJS/Runtime/VM.cpp b/Libraries/LibJS/Runtime/VM.cpp index ada54461755..45d37722288 100644 --- a/Libraries/LibJS/Runtime/VM.cpp +++ b/Libraries/LibJS/Runtime/VM.cpp @@ -169,13 +169,13 @@ VM::VM(OwnPtr custom_data, ErrorMessages error_messages) return HandledByHost::Handled; }; - // 3.6.1 HostInitializeShadowRealm ( realm ), https://tc39.es/proposal-shadowrealm/#sec-hostinitializeshadowrealm - // https://github.com/tc39/proposal-shadowrealm/pull/410 + // 3.6.1 HostInitializeShadowRealm ( realm, context, O ), https://tc39.es/proposal-shadowrealm/#sec-hostinitializeshadowrealm host_initialize_shadow_realm = [](Realm&, NonnullOwnPtr, ShadowRealm&) -> ThrowCompletionOr { - // The host-defined abstract operation HostInitializeShadowRealm takes argument realm (a Realm Record) and returns - // either a normal completion containing unused or a throw completion. It is used to inform the host of any newly - // created realms from the ShadowRealm constructor. The idea of this hook is to initialize host data structures - // related to the ShadowRealm, e.g., for module loading. + // The host-defined abstract operation HostInitializeShadowRealm takes arguments realm (a Realm Record), + // context (an execution context), and O (a ShadowRealm object) and returns either a normal completion + // containing unused or a throw completion. It is used to inform the host of any newly created realms + // from the ShadowRealm constructor. The idea of this hook is to initialize host data structures related + // to the ShadowRealm, e.g., for module loading. // // The host may use this hook to add properties to the ShadowRealm's global object. Those properties must be configurable. return {};