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

Unified Diff: src/parser.cc

Issue 1168643005: [es6] parse destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase on top of rest+arrow functions 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 96c269546f755b6a706a4cc9d13b555453ad3d25..a5a388eda47008dc1e1f37cf2adb017e80c543d9 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 ::

Powered by Google App Engine
This is Rietveld 408576698