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

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: Code review cleanup 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
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3d713517ce14d0d50aa52396113e2f577018d871 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,42 @@
assertEquals(42, o.g().next().value);
})();
+
+
+(function TestSuperPropertyInEval() {
+ var y = 3;
+ var p = {
+ m() { return 1; },
+ get x() { return 2; }
+ };
+ var o = {
+ __proto__: p,
+ 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()');
+ }
+ };
+ assertSame(1, o.eval());
+})();
+
+
+(function TestSuperPropertyInArrow() {
+ var y = 3;
+ var p = {
+ m() { return 1; },
+ get x() { return 2; }
+ };
+ var o = {
+ __proto__: p,
+ arrow() {
+ assertSame(super.x, (() => super.x)());
+ assertSame(super.m(), (() => super.m())());
+ return (() => super.m())();
+ }
+ };
+ assertSame(1, o.arrow());
+})();
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698