Skip to content

Commit aa7dc80

Browse files
camillobrunitargos
authored andcommitted
src: update ImportModuleDynamically
PR-URL: #41610 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 468fffd commit aa7dc80

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/module_wrap.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ using v8::PrimitiveArray;
4646
using v8::Promise;
4747
using v8::ScriptCompiler;
4848
using v8::ScriptOrigin;
49-
using v8::ScriptOrModule;
5049
using v8::String;
5150
using v8::UnboundModuleScript;
5251
using v8::Undefined;
@@ -559,7 +558,8 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
559558

560559
static 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

Comments
 (0)