Index: src/pattern-rewriter.cc |
diff --git a/src/pattern-rewriter.cc b/src/pattern-rewriter.cc |
index 090f85dc9c533ad68fcdb0bff435c7440152194d..f2c1240b9c5e0f98b0dd24e3aba1cb702f81ff2f 100644 |
--- a/src/pattern-rewriter.cc |
+++ b/src/pattern-rewriter.cc |
@@ -4,6 +4,7 @@ |
#include "src/ast.h" |
#include "src/messages.h" |
+#include "src/parameter-initializer-rewriter.h" |
#include "src/parser.h" |
namespace v8 { |
@@ -359,8 +360,16 @@ void Parser::PatternRewriter::VisitAssignment(Assignment* node) { |
Token::EQ_STRICT, factory()->NewVariableProxy(temp), |
factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), |
RelocInfo::kNoPosition); |
+ Expression* initializer = node->value(); |
+ if (descriptor_->declaration_kind == DeclarationDescriptor::PARAMETER && |
+ descriptor_->scope->is_arrow_scope()) { |
+ // TODO(adamk): Only call this if necessary. |
+ RewriteParameterInitializerScope( |
+ descriptor_->parser->stack_limit(), initializer, |
+ descriptor_->scope->outer_scope(), descriptor_->scope); |
+ } |
Expression* value = factory()->NewConditional( |
- is_undefined, node->value(), factory()->NewVariableProxy(temp), |
+ is_undefined, initializer, factory()->NewVariableProxy(temp), |
RelocInfo::kNoPosition); |
RecurseIntoSubpattern(node->target(), value); |
} |