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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: bytecode test Created 4 years, 3 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
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());
« no previous file with comments | « test/cctest/interpreter/generate-bytecode-expectations.cc ('k') | test/mjsunit/harmony/class-fields-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698