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

Unified Diff: test/mjsunit/harmony/new-target.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: Comment; added test for super calls 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
« no previous file with comments | « src/scopes.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/new-target.js
diff --git a/test/mjsunit/harmony/new-target.js b/test/mjsunit/harmony/new-target.js
index 0d2873b1dbcc1186a62744d7d6725fa832cc2ea1..9498099f50d13d9b26a8db8aa06710957201ee35 100644
--- a/test/mjsunit/harmony/new-target.js
+++ b/test/mjsunit/harmony/new-target.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-new-target --harmony-reflect
+// Flags: --harmony-new-target --harmony-reflect --harmony-destructuring
// Flags: --harmony-rest-parameters --harmony-arrow-functions
@@ -368,3 +368,17 @@
a2 = 3;
f(1, 2, 3);
})();
+
+
+(function TestOtherScopes() {
+ function f1() { return eval("'use strict'; new.target") }
+ assertSame(f1, new f1);
+ function f2() { with ({}) return new.target }
+ assertSame(f2, new f2);
+ function f3({a}) { return new.target }
+ assertSame(f3, new f3({}));
+ function f4(...a) { return new.target }
+ assertSame(f4, new f4);
+ function f5() { 'use strict'; { let x; return new.target } }
+ assertSame(f5, new f5);
+})();
« no previous file with comments | « src/scopes.cc ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698