Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1812)

Unified Diff: test/mjsunit/harmony/object-literals-super.js

Issue 1135243004: [es6] Support super.property in eval and arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: All ports done Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
+})();

Powered by Google App Engine
This is Rietveld 408576698