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

Unified Diff: test/mjsunit/harmony/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/mjsunit/harmony/object-literals-super.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+})();
« no previous file with comments | « test/mjsunit/harmony/object-literals-super.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698