Chromium Code Reviews| Index: test/mjsunit/harmony/object-literals-super.js |
| diff --git a/test/mjsunit/harmony/object-literals-super.js b/test/mjsunit/harmony/object-literals-super.js |
| index c2d456c8774eaf155aa4060e4a25271bb98b9095..e00a057407450560f006a23fb3372963de5df739 100644 |
| --- a/test/mjsunit/harmony/object-literals-super.js |
| +++ b/test/mjsunit/harmony/object-literals-super.js |
| @@ -2,7 +2,7 @@ |
| // 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 TestHomeObject() { |
| @@ -131,3 +131,31 @@ |
| assertEquals(42, o.g().next().value); |
| })(); |
| + |
| + |
| +(function TestSuperPropertyInEval() { |
| + var y = 3; |
| + var p = { |
| + m() { return 1; }, |
| + get x() { return 2; }, |
| + set y(v) { y = v; } |
| + }; |
| + var o = { |
| + __proto__: p, |
| + eval() { |
|
wingo
2015/05/15 14:59:35
This eval is not in the scope of the method? Stra
arv (Not doing code reviews)
2015/05/15 15:11:52
The method name does not create a binding. The mot
|
| + 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())(); |
| + } |
| + }; |
| + assertSame(1, o.eval()); |
| + assertSame(1, o.arrow()); |
| +})(); |