Index: src/scopes.cc |
diff --git a/src/scopes.cc b/src/scopes.cc |
index a5af8c015783152c94ae3b24a9cf6c137bb93dd6..8d23180f9e407bb43cb4a50599e6b130a5126c8b 100644 |
--- a/src/scopes.cc |
+++ b/src/scopes.cc |
@@ -163,6 +163,7 @@ |
scope_inside_with_ = false; |
scope_contains_with_ = false; |
scope_calls_eval_ = false; |
+ scope_uses_arguments_ = false; |
scope_uses_super_property_ = false; |
asm_module_ = false; |
asm_function_ = outer_scope != NULL && outer_scope->asm_module_; |
@@ -170,6 +171,7 @@ |
language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY; |
outer_scope_calls_sloppy_eval_ = false; |
inner_scope_calls_eval_ = false; |
+ inner_scope_uses_arguments_ = false; |
inner_scope_uses_super_property_ = false; |
force_eager_compilation_ = false; |
force_context_allocation_ = (outer_scope != NULL && !is_function_scope()) |
@@ -365,6 +367,7 @@ |
} |
// Propagate usage flags to outer scope. |
+ if (uses_arguments()) outer_scope_->RecordArgumentsUsage(); |
if (uses_super_property()) outer_scope_->RecordSuperPropertyUsage(); |
if (scope_calls_eval_) outer_scope_->RecordEvalCall(); |
@@ -912,8 +915,12 @@ |
if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n"); |
if (scope_contains_with_) Indent(n1, "// scope contains 'with'\n"); |
if (scope_calls_eval_) Indent(n1, "// scope calls 'eval'\n"); |
+ if (scope_uses_arguments_) Indent(n1, "// scope uses 'arguments'\n"); |
if (scope_uses_super_property_) |
Indent(n1, "// scope uses 'super' property\n"); |
+ if (inner_scope_uses_arguments_) { |
+ Indent(n1, "// inner scope uses 'arguments'\n"); |
+ } |
if (inner_scope_uses_super_property_) |
Indent(n1, "// inner scope uses 'super' property\n"); |
if (outer_scope_calls_sloppy_eval_) { |
@@ -1264,6 +1271,9 @@ |
// usage of arguments/super/this, but do not propagate them out from normal |
// functions. |
if (!inner->is_function_scope() || inner->is_arrow_scope()) { |
+ if (inner->scope_uses_arguments_ || inner->inner_scope_uses_arguments_) { |
+ inner_scope_uses_arguments_ = true; |
+ } |
if (inner->scope_uses_super_property_ || |
inner->inner_scope_uses_super_property_) { |
inner_scope_uses_super_property_ = true; |