Index: src/scopes.cc |
diff --git a/src/scopes.cc b/src/scopes.cc |
index 8d23180f9e407bb43cb4a50599e6b130a5126c8b..32bd4bfc41261485b9cbdeb3eb004e157b056c56 100644 |
--- a/src/scopes.cc |
+++ b/src/scopes.cc |
@@ -165,6 +165,7 @@ |
scope_calls_eval_ = false; |
scope_uses_arguments_ = false; |
scope_uses_super_property_ = false; |
+ scope_uses_this_ = false; |
asm_module_ = false; |
asm_function_ = outer_scope != NULL && outer_scope->asm_module_; |
// Inherit the language mode from the parent scope. |
@@ -172,6 +173,7 @@ |
outer_scope_calls_sloppy_eval_ = false; |
inner_scope_calls_eval_ = false; |
inner_scope_uses_arguments_ = false; |
+ inner_scope_uses_this_ = false; |
inner_scope_uses_super_property_ = false; |
force_eager_compilation_ = false; |
force_context_allocation_ = (outer_scope != NULL && !is_function_scope()) |
@@ -369,6 +371,7 @@ |
// Propagate usage flags to outer scope. |
if (uses_arguments()) outer_scope_->RecordArgumentsUsage(); |
if (uses_super_property()) outer_scope_->RecordSuperPropertyUsage(); |
+ if (uses_this()) outer_scope_->RecordThisUsage(); |
if (scope_calls_eval_) outer_scope_->RecordEvalCall(); |
return NULL; |
@@ -918,11 +921,13 @@ |
if (scope_uses_arguments_) Indent(n1, "// scope uses 'arguments'\n"); |
if (scope_uses_super_property_) |
Indent(n1, "// scope uses 'super' property\n"); |
+ if (scope_uses_this_) Indent(n1, "// scope uses 'this'\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 (inner_scope_uses_this_) Indent(n1, "// inner scope uses 'this'\n"); |
if (outer_scope_calls_sloppy_eval_) { |
Indent(n1, "// outer scope calls 'eval' in sloppy context\n"); |
} |
@@ -1278,6 +1283,9 @@ |
inner->inner_scope_uses_super_property_) { |
inner_scope_uses_super_property_ = true; |
} |
+ if (inner->scope_uses_this_ || inner->inner_scope_uses_this_) { |
+ inner_scope_uses_this_ = true; |
+ } |
} |
if (inner->force_eager_compilation_) { |
force_eager_compilation_ = true; |