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

Unified Diff: src/preparser.cc

Issue 1290013002: [es6] Make assignment to new.target an early ReferenceError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a few more tests 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 | « src/preparser.h ('k') | test/message/new-target-assignment.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index ec0ea2de3a04ba42bf5b32a54722420fb33de5d7..f186f8a694927d1808d48167b4de31340973c9d1 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -918,6 +918,8 @@ PreParser::Statement PreParser::ParseForStatement(bool* ok) {
lhs.IsIdentifier() && lhs.AsIdentifier().IsLet();
if (CheckInOrOf(lhs.IsIdentifier(), &mode, ok)) {
if (!*ok) return Statement::Default();
+ // TODO(adamk): Should call CheckAndRewriteReferenceExpression here
+ // to catch early errors if lhs is not a valid reference expression.
ParseExpression(true, CHECK_OK);
Expect(Token::RPAREN, CHECK_OK);
ParseSubStatement(CHECK_OK);
« no previous file with comments | « src/preparser.h ('k') | test/message/new-target-assignment.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698