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

Unified Diff: src/pattern-rewriter.cc

Issue 1139773005: [destructuring] More tests for object literal pattern (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More tests + fixed a bug Created 5 years, 7 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/pattern-rewriter.cc
diff --git a/src/pattern-rewriter.cc b/src/pattern-rewriter.cc
index 2319d1aaf73dd6f6a91746e490f45f7020f6fb30..97cda41efb264a864ca680308dcbbaaa681ef3a8 100644
--- a/src/pattern-rewriter.cc
+++ b/src/pattern-rewriter.cc
@@ -208,14 +208,18 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
void Parser::PatternRewriter::VisitObjectLiteral(ObjectLiteral* pattern) {
- auto temp = descriptor_->declaration_scope->NewTemporary(
+ auto temp = TemporaryDeclarationScope()->NewTemporary(
ast_value_factory()->empty_string());
auto assignment =
factory()->NewAssignment(Token::ASSIGN, factory()->NewVariableProxy(temp),
current_value_, RelocInfo::kNoPosition);
+
block_->AddStatement(
factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition),
zone());
+ block_->AddStatement(descriptor_->parser->BuildAssertIsCoercible(temp),
arv (Not doing code reviews) 2015/05/18 13:12:53 In theory this is only need when we have an empty
Dmitry Lomov (no reviews) 2015/05/18 13:41:46 Done.
+ zone());
+
for (ObjectLiteralProperty* property : *pattern->properties()) {
// TODO(dslomov): computed property names.
RecurseIntoSubpattern(

Powered by Google App Engine
This is Rietveld 408576698