Index: test/mjsunit/harmony/super.js |
diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js |
index 988cef22e2fdc959d2ae7de0878a48d748d44ac6..1af7ab2e234f97b3d48ef94935ab908a5cef034a 100644 |
--- a/test/mjsunit/harmony/super.js |
+++ b/test/mjsunit/harmony/super.js |
@@ -2,7 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// Flags: --harmony-classes --allow-natives-syntax |
+// Flags: --harmony-classes --harmony-arrow-functions --allow-natives-syntax |
+ |
(function TestSuperNamedLoads() { |
function Base() { } |
@@ -2053,6 +2054,7 @@ TestKeyedSetterCreatingOwnPropertiesNonConfigurable(42, 43, 44); |
assertInstanceof(f, Number); |
}()); |
+ |
(function TestSuperCallErrorCases() { |
'use strict'; |
class T extends Object { |
@@ -2064,3 +2066,44 @@ TestKeyedSetterCreatingOwnPropertiesNonConfigurable(42, 43, 44); |
T.__proto__ = null; |
assertThrows(function() { new T(); }, TypeError); |
}()); |
+ |
+ |
+(function TestSuperPropertyInEval() { |
+ 'use strict'; |
+ let y = 3; |
+ class Base { |
+ m() { return 1; } |
+ get x() { return 2; } |
+ } |
+ class Derived extends Base { |
+ eval() { |
+ assertSame(super.x, eval('super.x')); |
+ assertSame(super.m(), eval('super.m()')); |
+ // Global eval. |
+ assertThrows('super.x', SyntaxError); |
+ assertThrows('super.m()', SyntaxError); |
+ return eval('super.m()'); |
+ } |
+ } |
+ let d = new Derived(); |
+ assertSame(1, d.eval()); |
+})(); |
+ |
+ |
+(function TestSuperPropertyInArrow() { |
+ 'use strict'; |
+ let y = 3; |
+ class Base { |
+ m() { return 1; } |
+ get x() { return 2; } |
+ } |
+ class Derived extends Base { |
+ arrow() { |
+ assertSame(super.x, (() => super.x)()); |
+ assertSame(super.m(), (() => super.m())()); |
+ return (() => super.m())(); |
+ } |
+ } |
+ let d = new Derived(); |
+ assertSame(1, d.arrow()); |
+})(); |