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

Unified Diff: src/parser.cc

Issue 1173003002: Rebase for "parse destructuring assignment" patch (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 816849748869720029796504e4d282dc6ca1bb2e..3774203d571bee4ba4bfb206048bbd040e873eda 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2603,6 +2603,7 @@ Statement* Parser::ParseExpressionOrLabelledStatement(
}
bool starts_with_idenfifier = peek_any_identifier();
+
Expression* expr = ParseExpression(true, CHECK_OK);
if (peek() == Token::COLON && starts_with_idenfifier && expr != NULL &&
expr->AsVariableProxy() != NULL &&
@@ -3435,6 +3436,17 @@ Statement* Parser::DesugarLexicalBindingsInForStatement(
}
+Expression* Parser::DesugarDestructuringAssignment(Expression* expr, bool* ok) {
+ // TODO(caitp): implement the desugaring
+ DCHECK(expr->IsAssignment());
+ Assignment* assign = expr->AsAssignment();
+ while (assign->value()->IsAssignment()) {
+ assign = assign->value()->AsAssignment();
+ }
+ return assign->value();
+}
+
+
Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
bool* ok) {
// ForStatement ::
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698