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

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 + Bunch of tests + Nits fixed 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 7e0d9366116f3b8bd7619a78ceb39e6a6901cd1e..a6af7677c16c1426d5806a0838875fc4bf5b9897 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2611,6 +2611,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 &&
@@ -3459,6 +3460,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') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698