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

Unified Diff: src/scopes.h

Issue 1250513004: [es6] Make sure temporaries are not allocated in block scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/scopeinfo.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 e565ff69fe25f7c1197a341a5e96940ced953773..73277252e3ed1bb451f8507603256358ab03ac29 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -168,16 +168,11 @@ class Scope: public ZoneObject {
// such a variable again if it was added; otherwise this is a no-op.
void RemoveUnresolved(VariableProxy* var);
- // Creates a new internal variable in this scope. The name is only used
- // for printing and cannot be used to find the variable. In particular,
- // the only way to get hold of the temporary is by keeping the Variable*
- // around.
- Variable* NewInternal(const AstRawString* name);
-
- // Creates a new temporary variable in this scope. The name is only used
- // for printing and cannot be used to find the variable. In particular,
- // the only way to get hold of the temporary is by keeping the Variable*
- // around. The name should not clash with a legitimate variable names.
+ // 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.
+ // In particular, the only way to get hold of the temporary is by keeping the
+ // Variable* around. The name should not clash with a legitimate variable
+ // names.
Variable* NewTemporary(const AstRawString* name);
// Adds the specific declaration node to the list of declarations in
@@ -487,6 +482,11 @@ class Scope: public ZoneObject {
// the scope where var declarations will be hoisted to in the implementation.
Scope* DeclarationScope();
+ // Find the first non-block declaration scope. This should be either a script,
+ // function, or eval scope. Same as DeclarationScope(), but skips
+ // declaration "block" scopes. Used for declaring temporaries.
+ Scope* TemporaryScope();
+
// Find the first (non-arrow) function or script scope. This is where
// 'this' is bound, and what determines the function kind.
Scope* ReceiverScope();
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698