Index: test/cctest/interpreter/test-bytecode-generator.cc |
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc |
index 6ecd1216b41ec505f3307051d303d4e06d586bd1..fbcd297dd6cbe415ba7634887029cbe5030284ac 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -2203,6 +2203,47 @@ TEST(Generators) { |
LoadGolden("Generators.golden"))); |
} |
+TEST(Modules) { |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate()); |
+ printer.set_wrap(false); |
+ printer.set_module(true); |
+ printer.set_top_level(true); |
+ |
+ const char* snippets[] = { |
+ "import \"bar\";\n", |
+ |
+ "import {foo} from \"bar\";\n", |
+ |
+ "import {foo as goo} from \"bar\";\n" |
+ "goo(42);\n" |
+ "{ let x; { goo(42) } };\n", |
+ |
+ "export var foo = 42;\n" |
+ "foo++;\n" |
+ "{ let x; { foo++ } };\n", |
+ |
+ "export let foo = 42;\n" |
+ "foo++;\n" |
+ "{ let x; { foo++ } };\n", |
+ |
+ "export const foo = 42;\n" |
+ "foo++;\n" |
+ "{ let x; { foo++ } };\n", |
+ |
+ "export default (function () {});\n", |
+ |
+ "export default (class {});\n", |
+ |
+ "export {foo as goo} from \"bar\"\n", |
+ |
+ "export * from \"bar\"\n", |
+ }; |
+ |
+ CHECK(CompareTexts(BuildActual(printer, snippets), |
+ LoadGolden("Modules.golden"))); |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |