Index: src/scopes.cc |
=================================================================== |
--- src/scopes.cc (revision 9109) |
+++ src/scopes.cc (working copy) |
@@ -376,9 +376,11 @@ |
} |
-Variable* Scope::DeclareFunctionVar(Handle<String> name) { |
+VariableProxy* Scope::DeclareFunctionVar(Handle<String> name) { |
ASSERT(is_function_scope() && function_ == NULL); |
- function_ = new Variable(this, name, Variable::CONST, true, Variable::NORMAL); |
+ Variable* function_var = |
+ new Variable(this, name, Variable::CONST, true, Variable::NORMAL); |
+ function_ = new(isolate_->zone()) VariableProxy(isolate_, function_var); |
return function_; |
} |
@@ -715,7 +717,7 @@ |
PrettyPrinter printer; |
Indent(n1, "// function var\n"); |
if (function_ != NULL) { |
- PrintVar(&printer, n1, function_); |
+ PrintVar(&printer, n1, function_->var()); |
} |
Indent(n1, "// temporary vars\n"); |
@@ -795,8 +797,8 @@ |
// between this scope and the outer scope. (ECMA-262, 3rd., requires that |
// the name of named function literal is kept in an intermediate scope |
// in between this scope and the next outer scope.) |
- if (function_ != NULL && function_->name().is_identical_to(name)) { |
- var = function_; |
+ if (function_ != NULL && function_->var()->name().is_identical_to(name)) { |
Kevin Millikin (Chromium)
2011/09/01 15:40:58
function_->name() because the VariableProxy and Va
fschneider
2011/09/01 16:28:21
Done.
|
+ var = function_->var(); |
} else if (outer_scope_ != NULL) { |
var = outer_scope_->LookupRecursive( |
@@ -1114,7 +1116,7 @@ |
// because of the current ScopeInfo implementation (see |
// ScopeInfo::ScopeInfo(FunctionScope* scope) constructor). |
if (function_ != NULL) { |
- AllocateNonParameterLocal(function_); |
+ AllocateNonParameterLocal(function_->var()); |
} |
} |