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

Unified Diff: test/cctest/compiler/test-run-jsops.cc

Issue 798873006: First simple implementation of class literals in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 years, 11 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/types.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-jsops.cc
diff --git a/test/cctest/compiler/test-run-jsops.cc b/test/cctest/compiler/test-run-jsops.cc
index eb39760ff7ea945d438827230edee4b20672ebaa..df65afa6c50e80333bff4eac97546450e27a3379 100644
--- a/test/cctest/compiler/test-run-jsops.cc
+++ b/test/cctest/compiler/test-run-jsops.cc
@@ -522,3 +522,24 @@ TEST(RegExpLiteral) {
T.CheckTrue(T.Val("abc"));
T.CheckFalse(T.Val("xyz"));
}
+
+
+TEST(ClassLiteral) {
+ FLAG_harmony_classes = true;
+ FLAG_harmony_sloppy = true;
+ FLAG_harmony_object_literals = true;
+ const char* src =
+ "(function(a,b) {"
+ " class C {"
+ " x() { return a; }"
+ " static y() { return b; }"
+ " get z() { return 0; }"
+ " constructor() {}"
+ " }"
+ " return new C().x() + C.y();"
+ "})";
+ FunctionTester T(src);
+
+ T.CheckCall(T.Val(65), T.Val(23), T.Val(42));
+ T.CheckCall(T.Val("ab"), T.Val("a"), T.Val("b"));
+}
« no previous file with comments | « src/types.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698