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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1309813007: [es6] implement destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: An implementation Created 5 years, 1 month 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/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 92afa4fcc99c49f5cb8d43e74803ac99ec970366..54f435d9dca52db09026a96c24bfa7101269080b 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1697,6 +1697,11 @@ void AstGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) {
}
+void AstGraphBuilder::VisitAssignmentPattern(AssignmentPattern* expr) {
+ Visit(expr->expression());
+}
+
+
void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
Node* closure = GetFunctionClosure();
@@ -2056,6 +2061,10 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
void AstGraphBuilder::VisitAssignment(Assignment* expr) {
+ if (expr->target()->IsAssignmentPattern()) {
+ DCHECK(expr->target()->AsAssignmentPattern()->is_rewritten());
+ return Visit(expr->target()->AsAssignmentPattern()->expression());
+ }
DCHECK(expr->target()->IsValidReferenceExpressionOrThis());
// Left-hand side can only be a property, a global or a variable slot.

Powered by Google App Engine
This is Rietveld 408576698