Index: src/scopes.cc |
diff --git a/src/scopes.cc b/src/scopes.cc |
index a044b76baccc4c4b0d330aa0a749b5b022908610..6e1c18dc2e11b346c3c3e4914d58160a8027eb5c 100644 |
--- a/src/scopes.cc |
+++ b/src/scopes.cc |
@@ -763,24 +763,26 @@ int Scope::ContextChainLength(Scope* scope) { |
} |
-Scope* Scope::ScriptScope() { |
+Scope* Scope::DeclarationScope() { |
Scope* scope = this; |
- while (!scope->is_script_scope()) { |
+ while (!scope->is_declaration_scope()) { |
scope = scope->outer_scope(); |
} |
return scope; |
} |
-Scope* Scope::DeclarationScope() { |
+Scope* Scope::ReceiverScope() { |
Scope* scope = this; |
- while (!scope->is_declaration_scope()) { |
+ while (!scope->is_script_scope() && |
+ (!scope->is_function_scope() || scope->is_arrow_scope())) { |
scope = scope->outer_scope(); |
} |
return scope; |
} |
+ |
Handle<ScopeInfo> Scope::GetScopeInfo(Isolate* isolate) { |
if (scope_info_.is_null()) { |
scope_info_ = ScopeInfo::Create(isolate, zone(), this); |