Index: src/scopes.h |
diff --git a/src/scopes.h b/src/scopes.h |
index 16581d776f09355a099645170a69ce53bb0c18e1..8400094564cff764622a8b159745e33ba56ff14f 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 ReplaceOuterScope(Scope* outer_scope); |
+ |
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); |