Skip to content

Commit

Permalink
src: use non-deprecated V8 module APIs
Browse files Browse the repository at this point in the history
PR-URL: #37587
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
targos committed Mar 15, 2021
1 parent 64d5be2 commit 8f5cce6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
}

Local<String> source_text = args[2].As<String>();
ScriptOrigin origin(url,
ScriptOrigin origin(isolate,
url,
line_offset,
column_offset,
true, // is cross origin
Expand Down Expand Up @@ -539,7 +540,8 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
static MaybeLocal<Promise> ImportModuleDynamically(
Local<Context> context,
Local<ScriptOrModule> referrer,
Local<String> specifier) {
Local<String> specifier,
Local<FixedArray> import_assertions) {
Isolate* isolate = context->GetIsolate();
Environment* env = Environment::GetCurrent(context);
if (env == nullptr) {
Expand Down
6 changes: 4 additions & 2 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
host_defined_options->Set(isolate, loader::HostDefinedOptions::kID,
Number::New(isolate, contextify_script->id()));

ScriptOrigin origin(filename,
ScriptOrigin origin(isolate,
filename,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
Expand Down Expand Up @@ -1099,7 +1100,8 @@ void ContextifyContext::CompileFunction(
host_defined_options->Set(
isolate, loader::HostDefinedOptions::kID, Number::New(isolate, id));

ScriptOrigin origin(filename,
ScriptOrigin origin(isolate,
filename,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
Expand Down
2 changes: 1 addition & 1 deletion src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
std::string filename_s = std::string("node:") + id;
Local<String> filename =
OneByteString(isolate, filename_s.c_str(), filename_s.size());
ScriptOrigin origin(filename, 0, 0, true);
ScriptOrigin origin(isolate, filename, 0, 0, true);

ScriptCompiler::CachedData* cached_data = nullptr;
{
Expand Down

0 comments on commit 8f5cce6

Please sign in to comment.