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

Unified Diff: src/parser.cc

Issue 1168643005: [es6] parse destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arrow function parsing 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') | src/preparser.h » ('J')
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 a961f9140386b67cf84dbfb26b62341d37685dab..92f173198e56457491aae286c45fc36a3ca2377a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2594,6 +2594,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 &&
@@ -3430,6 +3431,17 @@ Statement* Parser::DesugarLexicalBindingsInForStatement(
}
+Expression* Parser::DesugarDestructuringAssignment(Expression* expr) {
+ // 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') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698