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

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

Issue 1105453002: Revert of [strong] checking of this & super in constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « 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 c329043ae16e3166b2e1f383c3f68202d061a8f8..50fe5a18ee9ea79fee331afd02d62539733b456f 100644
--- a/test/mjsunit/strong/classes.js
+++ b/test/mjsunit/strong/classes.js
@@ -28,32 +28,16 @@
"(class extends Object { constructor() { " + body + " } })";
}
-(function NoSuperExceptCall() {
- assertSyntaxError(constructor("super.a;"));
- assertSyntaxError(constructor("super['a'];"));
- assertSyntaxError(constructor("super.f();"));
- assertSyntaxError(constructor("super.a;"));
- assertSyntaxError(constructor("{ super.a }"));
- assertSyntaxError(constructor("if (0) super.a;"));
- // TODO(rossberg): arrow functions do not handle 'super' yet.
- // assertSyntaxError(constructor("() => super.a;"));
- // assertSyntaxError(constructor("() => () => super.a;"));
- // assertSyntaxError(constructor("() => { () => if (0) { super.a; } }"));
-})();
-
(function NoMissingSuper() {
assertReferenceError(constructor(""));
assertReferenceError(constructor("1"));
})();
(function NoNestedSuper() {
- assertSyntaxError(constructor("super(), 0;"));
assertSyntaxError(constructor("(super());"));
- assertSyntaxError(constructor("super().a;"));
assertSyntaxError(constructor("(() => super())();"));
assertSyntaxError(constructor("{ super(); }"));
assertSyntaxError(constructor("if (1) super();"));
- assertSyntaxError(constructor("label: super();"));
})();
(function NoDuplicateSuper() {
@@ -64,19 +48,9 @@
assertSyntaxError(constructor("super(); (() => super())();"));
})();
-(function NoSuperAfterThis() {
- assertSyntaxError(constructor("this.a = 0, super();"));
- assertSyntaxError(constructor("this.a = 0; super();"));
- assertSyntaxError(constructor("this.a = 0; super(); this.b = 0;"));
- assertSyntaxError(constructor("this.a = 0; (super());"));
- assertSyntaxError(constructor("super(this.a = 0);"));
-})();
-
(function NoReturnValue() {
assertSyntaxError(constructor("return {};"));
assertSyntaxError(constructor("return undefined;"));
- assertSyntaxError(constructor("return this;"));
- assertSyntaxError(constructor("return this.a = 0;"));
assertSyntaxError(constructor("{ return {}; }"));
assertSyntaxError(constructor("if (1) return {};"));
})();
@@ -86,34 +60,3 @@
assertSyntaxError(constructor("if (0) return; super();"));
assertSyntaxError(constructor("{ return; } super();"));
})();
-
-(function NoReturnBeforeThis() {
- assertSyntaxError(constructor("return; this.a = 0;"));
- assertSyntaxError(constructor("if (0) return; this.a = 0;"));
- assertSyntaxError(constructor("{ return; } this.a = 0;"));
-})();
-
-(function NoThisExceptInitialization() {
- assertSyntaxError(constructor("this;"));
- assertSyntaxError(constructor("this.a;"));
- assertSyntaxError(constructor("this['a'];"));
- assertSyntaxError(constructor("this();"));
- assertSyntaxError(constructor("this.a();"));
- assertSyntaxError(constructor("this.a.b = 0;"));
- assertSyntaxError(constructor("{ this }"));
- assertSyntaxError(constructor("if (0) this;"));
- // TODO(rossberg): this does not handle arrow functions yet.
- // assertSyntaxError(constructor("() => this;"));
- // assertSyntaxError(constructor("() => () => this;"));
- // assertSyntaxError(constructor("() => { () => if (0) { this; } }"));
-})();
-
-(function NoNestedThis() {
- assertSyntaxError(constructor("(this.a = 0);"));
- assertSyntaxError(constructor("{ this.a = 0; }"));
- assertSyntaxError(constructor("if (0) this.a = 0;"));
- // TODO(rossberg): this does not handle arrow functions yet.
- // assertSyntaxError(constructor("() => this.a = 0;"));
- // assertSyntaxError(constructor("() => { this.a = 0; }"));
- assertSyntaxError(constructor("label: this.a = 0;"));
-})();
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698