| Index: test/mjsunit/harmony/super.js
|
| diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js
|
| index 988cef22e2fdc959d2ae7de0878a48d748d44ac6..f796a3bb973f54bc921c8b88110fcdbfb9a3f868 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,32 @@ 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; }
|
| + set y(v) { y = v; }
|
| + }
|
| + 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()');
|
| + }
|
| + arrow() {
|
| + assertSame(super.x, (() => super.x)());
|
| + assertSame(super.m(), (() => super.m())());
|
| + return (() => super.m())();
|
| + }
|
| + }
|
| + let d = new Derived();
|
| + assertSame(1, d.eval());
|
| + assertSame(1, d.arrow());
|
| +})();
|
|
|