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); |
}()); |