summaryrefslogtreecommitdiff
path: root/deps/v8/src/scopes.h
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-06-09 08:09:42 -0700
committerisaacs <i@izs.me>2012-06-09 08:09:42 -0700
commit940a6863ead6622e5439e07be631359c31e63b68 (patch)
treec5aa25c048b8f0fd622d4c42fa134ca645fcbcd7 /deps/v8/src/scopes.h
parent569acea0eefed2c7da7453b7dcef6ff47491ca1c (diff)
downloadnode-940a6863ead6622e5439e07be631359c31e63b68.tar.gz
Roll V8 back to 3.9.24.31
Diffstat (limited to 'deps/v8/src/scopes.h')
-rw-r--r--deps/v8/src/scopes.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/deps/v8/src/scopes.h b/deps/v8/src/scopes.h
index be6705b32..174dbdbf0 100644
--- a/deps/v8/src/scopes.h
+++ b/deps/v8/src/scopes.h
@@ -126,9 +126,15 @@ class Scope: public ZoneObject {
// Declare the function variable for a function literal. This variable
// is in an intermediate scope between this function scope and the the
// outer scope. Only possible for function scopes; at most one variable.
- void DeclareFunctionVar(VariableDeclaration* declaration) {
- ASSERT(is_function_scope());
- function_ = declaration;
+ template<class Visitor>
+ Variable* DeclareFunctionVar(Handle<String> name,
+ VariableMode mode,
+ AstNodeFactory<Visitor>* factory) {
+ ASSERT(is_function_scope() && function_ == NULL);
+ Variable* function_var = new Variable(
+ this, name, mode, true, Variable::NORMAL, kCreatedInitialized);
+ function_ = factory->NewVariableProxy(function_var);
+ return function_var;
}
// Declare a parameter in this scope. When there are duplicated
@@ -306,8 +312,9 @@ class Scope: public ZoneObject {
Variable* receiver() { return receiver_; }
// The variable holding the function literal for named function
- // literals, or NULL. Only valid for function scopes.
- VariableDeclaration* function() const {
+ // literals, or NULL.
+ // Only valid for function scopes.
+ VariableProxy* function() const {
ASSERT(is_function_scope());
return function_;
}
@@ -442,7 +449,7 @@ class Scope: public ZoneObject {
// Convenience variable.
Variable* receiver_;
// Function variable, if any; function scopes only.
- VariableDeclaration* function_;
+ VariableProxy* function_;
// Convenience variable; function scopes only.
Variable* arguments_;
// Interface; module scopes only.