Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1782)

Unified Diff: test/cctest/test-modules.cc

Issue 2611643002: [modules] Add an IsModule flag to ScriptOriginOptions. (Closed)
Patch Set: Remove convenience function from API. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698