Skip to content

Commit 8f5cce6

Browse files
committed
src: use non-deprecated V8 module APIs
PR-URL: #37587 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 64d5be2 commit 8f5cce6

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Diff for: src/module_wrap.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
187187
}
188188

189189
Local<String> source_text = args[2].As<String>();
190-
ScriptOrigin origin(url,
190+
ScriptOrigin origin(isolate,
191+
url,
191192
line_offset,
192193
column_offset,
193194
true, // is cross origin
@@ -539,7 +540,8 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
539540
static MaybeLocal<Promise> ImportModuleDynamically(
540541
Local<Context> context,
541542
Local<ScriptOrModule> referrer,
542-
Local<String> specifier) {
543+
Local<String> specifier,
544+
Local<FixedArray> import_assertions) {
543545
Isolate* isolate = context->GetIsolate();
544546
Environment* env = Environment::GetCurrent(context);
545547
if (env == nullptr) {

Diff for: src/node_contextify.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
735735
host_defined_options->Set(isolate, loader::HostDefinedOptions::kID,
736736
Number::New(isolate, contextify_script->id()));
737737

738-
ScriptOrigin origin(filename,
738+
ScriptOrigin origin(isolate,
739+
filename,
739740
line_offset, // line offset
740741
column_offset, // column offset
741742
true, // is cross origin
@@ -1099,7 +1100,8 @@ void ContextifyContext::CompileFunction(
10991100
host_defined_options->Set(
11001101
isolate, loader::HostDefinedOptions::kID, Number::New(isolate, id));
11011102

1102-
ScriptOrigin origin(filename,
1103+
ScriptOrigin origin(isolate,
1104+
filename,
11031105
line_offset, // line offset
11041106
column_offset, // column offset
11051107
true, // is cross origin

Diff for: src/node_native_module.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
259259
std::string filename_s = std::string("node:") + id;
260260
Local<String> filename =
261261
OneByteString(isolate, filename_s.c_str(), filename_s.size());
262-
ScriptOrigin origin(filename, 0, 0, true);
262+
ScriptOrigin origin(isolate, filename, 0, 0, true);
263263

264264
ScriptCompiler::CachedData* cached_data = nullptr;
265265
{

0 commit comments

Comments
 (0)