Index: test/mjsunit/harmony/super.js |
diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js |
index 21b31d96c9b9bcac827f5c9a11e8f80f7050a164..270c159e80b22a1c9b1389e76d8d1262068205c2 100644 |
--- a/test/mjsunit/harmony/super.js |
+++ b/test/mjsunit/harmony/super.js |
@@ -2181,6 +2181,47 @@ TestKeyedSetterCreatingOwnPropertiesNonConfigurable(42, 43, 44); |
})(); |
+(function TestSuperCallInLoop() { |
+ 'use strict'; |
+ class Base { |
+ constructor(x) { |
+ this.x = x; |
+ } |
+ } |
+ class Derived extends Base { |
+ constructor(x, n) { |
+ for (var i = 0; i < n; ++i) { |
+ super(x); |
+ } |
+ } |
+ } |
+ |
+ let o = new Derived(23, 1); |
+ assertEquals(23, o.x); |
+ assertInstanceof(o, Derived); |
+ |
+ assertThrows("new Derived(42, 0)", ReferenceError); |
+ assertThrows("new Derived(65, 2)", ReferenceError); |
+})(); |
+ |
+ |
+(function TestSuperCallReentrant() { |
+ 'use strict'; |
+ class Base { |
+ constructor(fun) { |
+ this.x = fun(); |
+ } |
+ } |
+ class Derived extends Base { |
+ constructor(x) { |
+ let f = () => super(() => x) |
+ super(f); |
+ } |
+ } |
+ assertThrows("new Derived(23)", ReferenceError); |
+})(); |
+ |
+ |
(function TestSuperCallSpreadInEval() { |
'use strict'; |
class Base { |