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

Unified Diff: src/parser.cc

Issue 1168643005: [es6] parse destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits ForIn/Of tests 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') | test/cctest/test-parsing.cc » ('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 75bfbe25ab84611b2a14a95be4f098cd17073728..278bac1eb87a2032c12db580050216c9826c703c 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') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698