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 251d29cc3f3e8ddf46bcae7035b36ee579d1a466..51bbb1436424c1bd66b66e9b0992988c2747d1d2 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -2167,6 +2167,33 @@ TEST(ClassAndSuperClass) { |
LoadGolden("ClassAndSuperClass.golden"))); |
} |
+TEST(ClassFields) { |
+ bool old_flag = FLAG_harmony_class_fields; |
+ FLAG_harmony_class_fields = true; |
+ |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate()); |
+ const char* snippets[] = { |
+ "return new class {\n" |
+ " 'a' = 0;\n" |
+ " ['b'+'c'] = 1;\n" |
+ " static d = 2;\n" |
+ "}\n", |
+ |
+ "return new class extends class {} {\n" |
+ " constructor(){ super() }\n" |
+ " 'a' = 0;\n" |
+ " ['b'+'c'] = 1;\n" |
+ " static d = 2;\n" |
+ "}\n", |
+ }; |
+ |
+ CHECK(CompareTexts(BuildActual(printer, snippets), |
+ LoadGolden("ClassFields.golden"))); |
+ |
+ FLAG_harmony_class_fields = old_flag; |
+} |
+ |
TEST(Generators) { |
InitializedIgnitionHandleScope scope; |
BytecodeExpectationsPrinter printer(CcTest::isolate()); |