Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index 8b2813cf8e0cdc02abda8803f1604b4676327ed2..a532a2ca50da1450732530641217443d27011a7e 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -5218,11 +5218,11 @@ TEST(ModuleParsingInternals) { |
| isolate->stack_guard()->SetStackLimit(i::GetCurrentStackPosition() - |
| 128 * 1024); |
| - static const char kSource[] = "let x = 5; export { x as y };"; |
| + static const char kSource[] = |
| + "let x = 5; export { x as y }; import { q as z } from 'm.js';"; |
| i::Handle<i::String> source = factory->NewStringFromAsciiChecked(kSource); |
| i::Handle<i::Script> script = factory->NewScript(source); |
| i::CompilationInfoWithZone info(script); |
| - i::AstValueFactory avf(info.zone(), isolate->heap()->HashSeed()); |
| i::Parser parser(&info, isolate->stack_guard()->real_climit(), |
| isolate->heap()->HashSeed(), isolate->unicode_cache()); |
| parser.set_allow_harmony_modules(true); |
| @@ -5233,15 +5233,23 @@ TEST(ModuleParsingInternals) { |
| CHECK_EQ(i::MODULE_SCOPE, func->scope()->scope_type()); |
| i::ModuleDescriptor* descriptor = func->scope()->module(); |
| CHECK_NOT_NULL(descriptor); |
| - const i::AstRawString* name_x = avf.GetOneByteString("x"); |
| - const i::AstRawString* name_y = avf.GetOneByteString("y"); |
| int num_exports = 0; |
| for (auto it = descriptor->iterator(); !it.done(); it.Advance()) { |
| ++num_exports; |
| - CHECK(*name_x == *it.local_name()); |
| - CHECK(*name_y == *it.export_name()); |
| + CHECK(it.local_name()->IsOneByteEqualTo("x")); |
| + CHECK(it.export_name()->IsOneByteEqualTo("y")); |
| } |
| CHECK_EQ(1, num_exports); |
| + i::ZoneList<i::Declaration*>* declarations = func->scope()->declarations(); |
| + CHECK_EQ(2, declarations->length()); |
| + for (int i = 0; i < declarations->length(); ++i) { |
| + i::ImportDeclaration* decl = declarations->at(i)->AsImportDeclaration(); |
|
arv (Not doing code reviews)
2015/02/25 16:07:25
Maybe remove the loop and check x and z separately
adamk
2015/02/25 21:43:12
Done.
|
| + if (decl != NULL) { |
| + CHECK(decl->import_name()->IsOneByteEqualTo("q")); |
| + CHECK(decl->proxy()->raw_name()->IsOneByteEqualTo("z")); |
| + CHECK(decl->module_specifier()->IsOneByteEqualTo("m.js")); |
| + } |
| + } |
| } |