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

Unified Diff: test/mjsunit/harmony/super.js

Issue 923443003: new classes: no longer experimental. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more rebase? Created 5 years, 10 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/mjsunit/harmony/classes-experimental.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/super.js
diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js
index ddc29d216b900fe0ef4db8f1b118e6a664447c91..d5296424368412af771fb257327bcf63bd7a7801 100644
--- a/test/mjsunit/harmony/super.js
+++ b/test/mjsunit/harmony/super.js
@@ -1818,23 +1818,14 @@
assertEquals("base", d.fromBase);
assertEquals("derived", d.fromDerived);
- class ImplicitSubclassOfFunction {
- constructor() {
- super();
- this.x = 123;
- }
- }
-
- var o = new ImplicitSubclassOfFunction();
- assertEquals(123, o.x);
-
var calls = 0;
class G {
constructor() {
calls++;
}
}
- class F {
+
+ class F extends Object {
constructor() {
super();
}
@@ -1848,84 +1839,23 @@
}());
-(function TestSuperCallErrorCases() {
+(function TestExtendsObject() {
'use strict';
- class T {
- constructor() {
- super();
- }
- }
+ class F extends Object { }
+ var f = new F(42);
- T.__proto__ = null;
- assertThrows(function() { new T(); }, TypeError);
+ // TODO(dslomov,arv): Fix this. BUG=v8:3886.
+ assertTrue(f instanceof Number);
}());
-
-(function TestSuperCallSyntacticRestriction() {
+(function TestSuperCallErrorCases() {
'use strict';
- assertThrows(function() {
- class C {
- constructor() {
- super(this.x);
- }
- }
- new C();
- }, TypeError);
- assertThrows(function() {
- class C {
- constructor() {
- super(this);
- }
- }
- new C();
- }, TypeError);
- assertThrows(function() {
- class C {
- constructor() {
- super(1, 2, Object.getPrototypeOf(this));
- }
- }
- new C();
- }, TypeError);
- assertThrows(function() {
- class C {
- constructor() {
- { super(1, 2); }
- }
- }
- new C();
- }, TypeError);
- assertThrows(function() {
- class C {
- constructor() {
- if (1) super();
- }
- }
- new C();
- }, TypeError);
-
- class C1 {
- constructor() {
- 'use strict';
- super();
- }
- }
- new C1();
-
- class C2 {
+ class T extends Object {
constructor() {
- ; 'use strict';;;;;
super();
}
}
- new C2();
- class C3 {
- constructor() {
- ; 'use strict';;;;;
- // This is a comment.
- super();
- }
- }
- new C3();
+ T.__proto__ = null;
+ assertThrows(function() { new T(); }, TypeError);
}());
« no previous file with comments | « test/mjsunit/harmony/classes-experimental.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698