Index: src/scopes.h |
diff --git a/src/scopes.h b/src/scopes.h |
index 40863800e492da1c8983ed4015e0cc3b2339b0a1..9f913450abd9f7f8622ef1b85082bd4c3e43a15b 100644 |
--- a/src/scopes.h |
+++ b/src/scopes.h |
@@ -280,14 +280,13 @@ class Scope: public ZoneObject { |
bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; } |
bool is_with_scope() const { return scope_type_ == WITH_SCOPE; } |
bool is_arrow_scope() const { return scope_type_ == ARROW_SCOPE; } |
- bool is_declaration_scope() const { |
- return is_eval_scope() || is_function_scope() || |
- is_module_scope() || is_script_scope(); |
- } |
+ bool is_declaration_scope() const { return is_declaration_scope_; } |
bool is_strict_eval_scope() const { |
return is_eval_scope() && is_strict(language_mode_); |
} |
+ void set_is_declaration_scope() { is_declaration_scope_ = true; } |
+ |
// Information about which scopes calls eval. |
bool calls_eval() const { return scope_calls_eval_; } |
bool calls_sloppy_eval() { |
@@ -614,6 +613,9 @@ class Scope: public ZoneObject { |
// constructed based on a serialized scope info or a catch context). |
bool already_resolved_; |
+ // True if it holds 'var' declarations. |
+ bool is_declaration_scope_; |
+ |
// Computed as variables are declared. |
int num_var_or_const_; |