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

Unified Diff: src/preparser.cc

Issue 1411873004: [es6] allow any LeftHandSideExpression in for-of loops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bug in loop-assignment-analyzer which resulted in incorrect code Created 5 years, 1 month 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/mjsunit/es6/for-of.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 ff98f0817f2f2b6985e4f4e2ce18dc30c188a7f8..a12bf14e5860f50b8f4e0cf2a22f778aa1c99d95 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -925,8 +925,7 @@ PreParser::Statement PreParser::ParseForStatement(bool* ok) {
&first_initializer_loc, &bindings_loc,
CHECK_OK);
bool accept_IN = decl_count >= 1;
- bool accept_OF = true;
- if (accept_IN && CheckInOrOf(accept_OF, &mode, ok)) {
+ if (accept_IN && CheckInOrOf(&mode, ok)) {
if (!*ok) return Statement::Default();
if (decl_count != 1) {
const char* loop_type =
@@ -961,7 +960,7 @@ PreParser::Statement PreParser::ParseForStatement(bool* ok) {
int lhs_end_pos = scanner()->location().end_pos;
is_let_identifier_expression =
lhs.IsIdentifier() && lhs.AsIdentifier().IsLet();
- if (CheckInOrOf(lhs.IsIdentifier(), &mode, ok)) {
+ if (CheckInOrOf(&mode, ok)) {
if (!*ok) return Statement::Default();
lhs = CheckAndRewriteReferenceExpression(
lhs, lhs_beg_pos, lhs_end_pos, MessageTemplate::kInvalidLhsInFor,
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/es6/for-of.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698