Chromium Code Reviews| Index: src/scopes.h |
| diff --git a/src/scopes.h b/src/scopes.h |
| index 16581d776f09355a099645170a69ce53bb0c18e1..f0ff0dee3c174aee45a75a76097d7ec9a6405d12 100644 |
| --- a/src/scopes.h |
| +++ b/src/scopes.h |
| @@ -112,6 +112,11 @@ class Scope: public ZoneObject { |
| // tree and its children are reparented. |
| Scope* FinalizeBlockScope(); |
| + // Inserts outer_scope into this scope's scope chain (and removes this |
| + // from the current outer_scope_'s inner_scopes_). |
| + // Assumes outer_scope_ is non-null. |
| + void ResetOuterScope(Scope* outer_scope); |
|
rossberg
2015/10/21 10:46:59
Nit: "Reset" is not very telling, how about "Repla
adamk
2015/10/21 10:58:35
Done.
|
| + |
| Zone* zone() const { return zone_; } |
| // --------------------------------------------------------------------------- |
| @@ -178,13 +183,19 @@ class Scope: public ZoneObject { |
| return proxy; |
| } |
| + void AddUnresolved(VariableProxy* proxy) { |
| + DCHECK(!already_resolved()); |
| + DCHECK(!proxy->is_resolved()); |
| + unresolved_.Add(proxy, zone_); |
| + } |
| + |
| // Remove a unresolved variable. During parsing, an unresolved variable |
| // may have been added optimistically, but then only the variable name |
| // was used (typically for labels). If the variable was not declared, the |
| // addition introduced a new unresolved variable which may end up being |
| // allocated globally as a "ghost" variable. RemoveUnresolved removes |
| // such a variable again if it was added; otherwise this is a no-op. |
| - void RemoveUnresolved(VariableProxy* var); |
| + bool RemoveUnresolved(VariableProxy* var); |
| // Creates a new temporary variable in this scope's TemporaryScope. The |
| // name is only used for printing and cannot be used to find the variable. |
| @@ -813,6 +824,16 @@ class Scope: public ZoneObject { |
| } |
| } |
| + void RemoveInnerScope(Scope* inner_scope) { |
| + DCHECK_NOT_NULL(inner_scope); |
| + for (int i = 0; i < inner_scopes_.length(); i++) { |
| + if (inner_scopes_[i] == inner_scope) { |
| + inner_scopes_.Remove(i); |
| + break; |
| + } |
| + } |
| + } |
| + |
| void SetDefaults(ScopeType type, Scope* outer_scope, |
| Handle<ScopeInfo> scope_info, |
| FunctionKind function_kind = kNormalFunction); |