Index: test/cctest/test-modules.cc |
diff --git a/test/cctest/test-modules.cc b/test/cctest/test-modules.cc |
index e086a407f9e669bf9dabef6ddc8396aef1349524..9a9bfef990346dba553648012373fa73d94d178c 100644 |
--- a/test/cctest/test-modules.cc |
+++ b/test/cctest/test-modules.cc |
@@ -19,6 +19,14 @@ using v8::ScriptOrigin; |
using v8::String; |
using v8::Value; |
+ScriptOrigin ModuleOrigin(Local<v8::Value> resource_name, Isolate* isolate) { |
+ ScriptOrigin origin(resource_name, Local<v8::Integer>(), Local<v8::Integer>(), |
+ Local<v8::Boolean>(), Local<v8::Integer>(), |
+ Local<v8::Value>(), Local<v8::Boolean>(), |
+ Local<v8::Boolean>(), True(isolate)); |
+ return origin; |
+} |
+ |
MaybeLocal<Module> AlwaysEmptyResolveCallback(Local<Context> context, |
Local<String> specifier, |
Local<Module> referrer) { |
@@ -31,7 +39,7 @@ MaybeLocal<Module> FailOnSecondCallResolveCallback(Local<Context> context, |
Local<Module> referrer) { |
if (g_count++ > 0) return MaybeLocal<Module>(); |
Local<String> source_text = v8_str(""); |
- ScriptOrigin origin(v8_str("module.js")); |
+ ScriptOrigin origin = ModuleOrigin(v8_str("module.js"), CcTest::isolate()); |
ScriptCompiler::Source source(source_text, origin); |
return ScriptCompiler::CompileModule(CcTest::isolate(), &source) |
.ToLocalChecked(); |
@@ -45,7 +53,7 @@ TEST(ModuleInstantiationFailures) { |
Local<String> source_text = v8_str( |
"import './foo.js';" |
"export {} from './bar.js';"); |
- ScriptOrigin origin(v8_str("file.js")); |
+ ScriptOrigin origin = ModuleOrigin(v8_str("file.js"), CcTest::isolate()); |
ScriptCompiler::Source source(source_text, origin); |
Local<Module> module = |
ScriptCompiler::CompileModule(isolate, &source).ToLocalChecked(); |
@@ -66,7 +74,7 @@ TEST(ModuleInstantiationFailures) { |
static MaybeLocal<Module> CompileSpecifierAsModuleResolveCallback( |
Local<Context> context, Local<String> specifier, Local<Module> referrer) { |
- ScriptOrigin origin(v8_str("module.js")); |
+ ScriptOrigin origin = ModuleOrigin(v8_str("module.js"), CcTest::isolate()); |
ScriptCompiler::Source source(specifier, origin); |
return ScriptCompiler::CompileModule(CcTest::isolate(), &source) |
.ToLocalChecked(); |
@@ -80,7 +88,7 @@ TEST(ModuleEvaluation) { |
Local<String> source_text = v8_str( |
"import 'Object.expando = 5';" |
"import 'Object.expando *= 2';"); |
- ScriptOrigin origin(v8_str("file.js")); |
+ ScriptOrigin origin = ModuleOrigin(v8_str("file.js"), CcTest::isolate()); |
ScriptCompiler::Source source(source_text, origin); |
Local<Module> module = |
ScriptCompiler::CompileModule(isolate, &source).ToLocalChecked(); |