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

Unified Diff: test/mjsunit/harmony/super.js

Issue 1244423003: [es6] Fix function context check for super and new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« src/scopes.h ('K') | « test/mjsunit/harmony/new-target.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 ab572b056f262e39dcf522d090cc9667c19309dd..576786f94ef880e1c6a7b5a48fa5a89d261b4cc8 100644
--- a/test/mjsunit/harmony/super.js
+++ b/test/mjsunit/harmony/super.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --harmony-arrow-functions --allow-natives-syntax
-// Flags: --harmony-spreadcalls
+// Flags: --harmony-spreadcalls --harmony-destructuring --harmony-rest-parameters
(function TestSuperNamedLoads() {
function Base() { }
@@ -2122,6 +2122,21 @@ TestKeyedSetterCreatingOwnPropertiesNonConfigurable(42, 43, 44);
})();
+(function TestSuperInOtherScopes() {
+ var p = {x: 99};
+ var o0 = {__proto__: p, f() { return eval("'use strict'; super.x") }};
+ assertEquals(p.x, o0.f());
+ var o1 = {__proto__: p, f() { with ({}) return super.x }};
+ assertEquals(p.x, o1.f());
+ var o2 = {__proto__: p, f({a}) { return super.x }};
+ assertEquals(p.x, o2.f({}));
+ var o3 = {__proto__: p, f(...a) { return super.x }};
+ assertEquals(p.x, o3.f());
+ var o4 = {__proto__: p, f() { 'use strict'; { let x; return super.x } }};
+ assertEquals(p.x, o4.f());
+})();
+
+
(function TestSuperCallInEval() {
'use strict';
class Base {
« src/scopes.h ('K') | « test/mjsunit/harmony/new-target.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698