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

Unified Diff: test/mjsunit/harmony/new-target.js

Issue 1290013002: [es6] Make assignment to new.target an early ReferenceError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added a TODO in PreParser::ParseForStatement for missing check Created 5 years, 4 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/message/new-target-prefix-op.out ('k') | no next file » | 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 fa5b37282018d2615a83dc05cfff0f4738aefa38..394e93901299129ce20c334e282c3f1eab4e9218 100644
--- a/test/mjsunit/harmony/new-target.js
+++ b/test/mjsunit/harmony/new-target.js
@@ -384,3 +384,11 @@
function f6() { with ({'new.target': 42}) return new.target }
assertSame(f6, new f6);
})();
+
+
+(function TestEarlyErrors() {
+ assertThrows(function() { Function("new.target = 42"); }, ReferenceError);
rossberg 2015/08/13 11:13:54 Could add a case for at least one compound assignm
adamk 2015/08/13 17:05:44 Done. Added a few more tests here.
+ assertThrows(function() { Function("new.target--"); }, ReferenceError);
+ assertThrows(function() { Function("--new.target"); }, ReferenceError);
+ assertThrows(function() { Function("for (new.target of {});"); }, ReferenceError);
+})();
« no previous file with comments | « test/message/new-target-prefix-op.out ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698