diff options
author | Camillo Bruni <cbruni@chromium.org> | 2021-11-15 17:34:38 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2022-02-02 19:24:56 +0300 |
commit | aa7dc808f5242f2efdb4cd83ea62cd8c921328d0 (patch) | |
tree | dbc9f3a941e50cb44be780ba5e5fdbf4ce643d9c /src/module_wrap.cc | |
parent | 468fffdf66d36e99e7e2570750a4ffb0334df758 (diff) |
src: update ImportModuleDynamically
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r-- | src/module_wrap.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc index aeb0d2cb373..1e049d7258d 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -46,7 +46,6 @@ using v8::PrimitiveArray; using v8::Promise; using v8::ScriptCompiler; using v8::ScriptOrigin; -using v8::ScriptOrModule; using v8::String; using v8::UnboundModuleScript; using v8::Undefined; @@ -559,7 +558,8 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback( static MaybeLocal<Promise> ImportModuleDynamically( Local<Context> context, - Local<ScriptOrModule> referrer, + Local<v8::Data> host_defined_options, + Local<Value> resource_name, Local<String> specifier, Local<FixedArray> import_assertions) { Isolate* isolate = context->GetIsolate(); @@ -574,7 +574,7 @@ static MaybeLocal<Promise> ImportModuleDynamically( Local<Function> import_callback = env->host_import_module_dynamically_callback(); - Local<PrimitiveArray> options = referrer->GetHostDefinedOptions(); + Local<FixedArray> options = host_defined_options.As<FixedArray>(); if (options->Length() != HostDefinedOptions::kLength) { Local<Promise::Resolver> resolver; if (!Promise::Resolver::New(context).ToLocal(&resolver)) return {}; @@ -588,11 +588,11 @@ static MaybeLocal<Promise> ImportModuleDynamically( Local<Value> object; - int type = options->Get(isolate, HostDefinedOptions::kType) + int type = options->Get(context, HostDefinedOptions::kType) .As<Number>() ->Int32Value(context) .ToChecked(); - uint32_t id = options->Get(isolate, HostDefinedOptions::kID) + uint32_t id = options->Get(context, HostDefinedOptions::kID) .As<Number>() ->Uint32Value(context) .ToChecked(); |