Index: src/parsing/parameter-initializer-rewriter.cc |
diff --git a/src/parsing/parameter-initializer-rewriter.cc b/src/parsing/parameter-initializer-rewriter.cc |
index eaf1889392086294270d5526163d4d33c080a866..003bbebae016562d8a4e2696b0fd4e69a0920ba1 100644 |
--- a/src/parsing/parameter-initializer-rewriter.cc |
+++ b/src/parsing/parameter-initializer-rewriter.cc |
@@ -60,8 +60,14 @@ void Rewriter::VisitClassLiteral(ClassLiteral* class_literal) { |
void Rewriter::VisitVariableProxy(VariableProxy* proxy) { |
- DCHECK(!proxy->is_resolved()); |
- if (old_scope_->RemoveUnresolved(proxy)) { |
+ if (proxy->is_resolved()) { |
+ Variable* var = proxy->var(); |
+ DCHECK_EQ(var->mode(), TEMPORARY); |
+ if (old_scope_->RemoveTemporary(var)) { |
+ var->set_scope(new_scope_); |
+ new_scope_->AddTemporary(var); |
+ } |
+ } else if (old_scope_->RemoveUnresolved(proxy)) { |
new_scope_->AddUnresolved(proxy); |
} |
} |