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

Unified Diff: test/mjsunit/strong/classes.js

Issue 1019283002: [strong] Check constructor returns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« test/cctest/test-parsing.cc ('K') | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/classes.js
diff --git a/test/mjsunit/strong/classes.js b/test/mjsunit/strong/classes.js
index d5c4560844e688b2fa335f3b63b62ab9b4dbd9ca..e33742af3fbd6373f68ac69b073e5b47a15c72d4 100644
--- a/test/mjsunit/strong/classes.js
+++ b/test/mjsunit/strong/classes.js
@@ -32,9 +32,9 @@ function constructor(body) {
})();
(function NoNestedSuper() {
- assertSyntaxError(constructor("(super())"));
- assertSyntaxError(constructor("(() => super())(); } })"));
- assertSyntaxError(constructor("{ super();"));
+ assertSyntaxError(constructor("(super());"));
+ assertSyntaxError(constructor("(() => super())();"));
+ assertSyntaxError(constructor("{ super(); }"));
assertSyntaxError(constructor("if (1) super();"));
})();
@@ -43,4 +43,18 @@ function constructor(body) {
assertSyntaxError(constructor("super(); super();"));
assertSyntaxError(constructor("super(); (super());"));
assertSyntaxError(constructor("super(); { super() }"));
+ assertSyntaxError(constructor("super(); (() => super())();"));
+})();
+
+(function NoReturnValue() {
+ assertSyntaxError(constructor("return {};"));
+ assertSyntaxError(constructor("return undefined;"));
+ assertSyntaxError(constructor("{ return {}; }"));
+ assertSyntaxError(constructor("if (1) return {};"));
+})();
+
+(function NoReturnBeforeSuper() {
+ assertSyntaxError(constructor("return; super();"));
+ assertSyntaxError(constructor("if (0) return; super();"));
+ assertSyntaxError(constructor("{ return; } super();"));
})();
« test/cctest/test-parsing.cc ('K') | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698