Index: src/scopes.h |
diff --git a/src/scopes.h b/src/scopes.h |
index 9f913450abd9f7f8622ef1b85082bd4c3e43a15b..3f791378482a31c38462f6562a308b89d7511efd 100644 |
--- a/src/scopes.h |
+++ b/src/scopes.h |
@@ -489,6 +489,17 @@ class Scope: public ZoneObject { |
// where var declarations will be hoisted to in the implementation. |
Scope* DeclarationScope(); |
+ // Find the first non-block declaration scope. This should be either a global, |
+ // eval or function top scope. Used for declaring temporaries |
+ Scope* TempScope() { |
+ Scope* s = DeclarationScope(); |
+ if (s->is_block_scope()) { |
+ s = s->outer_scope(); |
rossberg
2015/07/17 08:38:05
We may potentially want to use declaration blocks
caitp (gmail)
2015/07/17 15:43:23
done in refactor
|
+ DCHECK(s->is_function_scope()); |
+ } |
+ return s; |
+ } |
+ |
Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); |
// Get the chain of nested scopes within this scope for the source statement |