@@ -46,7 +46,6 @@ using v8::PrimitiveArray;
4646using v8::Promise;
4747using v8::ScriptCompiler;
4848using v8::ScriptOrigin;
49- using v8::ScriptOrModule;
5049using v8::String;
5150using v8::UnboundModuleScript;
5251using v8::Undefined;
@@ -559,7 +558,8 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
559558
560559static MaybeLocal<Promise> ImportModuleDynamically (
561560 Local<Context> context,
562- Local<ScriptOrModule> referrer,
561+ Local<v8::Data> host_defined_options,
562+ Local<Value> resource_name,
563563 Local<String> specifier,
564564 Local<FixedArray> import_assertions) {
565565 Isolate* isolate = context->GetIsolate ();
@@ -574,7 +574,7 @@ static MaybeLocal<Promise> ImportModuleDynamically(
574574 Local<Function> import_callback =
575575 env->host_import_module_dynamically_callback ();
576576
577- Local<PrimitiveArray > options = referrer-> GetHostDefinedOptions ();
577+ Local<FixedArray > options = host_defined_options. As <FixedArray> ();
578578 if (options->Length () != HostDefinedOptions::kLength ) {
579579 Local<Promise::Resolver> resolver;
580580 if (!Promise::Resolver::New (context).ToLocal (&resolver)) return {};
@@ -588,11 +588,11 @@ static MaybeLocal<Promise> ImportModuleDynamically(
588588
589589 Local<Value> object;
590590
591- int type = options->Get (isolate , HostDefinedOptions::kType )
591+ int type = options->Get (context , HostDefinedOptions::kType )
592592 .As <Number>()
593593 ->Int32Value (context)
594594 .ToChecked ();
595- uint32_t id = options->Get (isolate , HostDefinedOptions::kID )
595+ uint32_t id = options->Get (context , HostDefinedOptions::kID )
596596 .As <Number>()
597597 ->Uint32Value (context)
598598 .ToChecked ();
0 commit comments