Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: src/scopes.h

Issue 1240463002: [es6] Implement inner scope for functions with destructuring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add tests for function name Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698