Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
src: use non-deprecated V8 module APIs
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
Showing
with
9 additions
and
5 deletions.
-
+4
−2
src/module_wrap.cc
-
+4
−2
src/node_contextify.cc
-
+1
−1
src/node_native_module.cc
|
|
@@ -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 |
|
|
@@ -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) { |
|
|
|
|
|
@@ -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 |
|
|
@@ -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 |
|
|
|
|
|
@@ -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; |
|
|
{ |
|
|
|