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

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

Issue 1078903002: Collect list of requested modules in ModuleDescriptor while parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 72077cc8da3239a2cd628fe6aae4f6d97870e9c9..6f5708110b64194d9cf8401901948981769a99eb 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5445,7 +5445,8 @@ TEST(ModuleParsingInternals) {
"let x = 5;"
"export { x as y };"
"import { q as z } from 'm.js';"
- "import n from 'n.js'";
+ "import n from 'n.js';"
+ "export { a as b } from 'm.js';";
i::Handle<i::String> source = factory->NewStringFromAsciiChecked(kSource);
i::Handle<i::Script> script = factory->NewScript(source);
i::Zone zone;
@@ -5485,6 +5486,12 @@ TEST(ModuleParsingInternals) {
CHECK(import_decl->import_name()->IsOneByteEqualTo("default"));
CHECK(import_decl->proxy()->raw_name()->IsOneByteEqualTo("n"));
CHECK(import_decl->module_specifier()->IsOneByteEqualTo("n.js"));
+ // TODO(adamk): Add test for indirect exports once they're fully implemented.
+ const i::ZoneList<const i::AstRawString*>& requested_modules =
+ descriptor->requested_modules();
+ CHECK_EQ(2, requested_modules.length());
+ CHECK(requested_modules[0]->IsOneByteEqualTo("m.js"));
+ CHECK(requested_modules[1]->IsOneByteEqualTo("n.js"));
}
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698