| Index: src/scopes.cc
|
| diff --git a/src/scopes.cc b/src/scopes.cc
|
| index 61024426e3ca9b76545e25b3b5ef373733f2697a..e159257164086840e690f66f4006a202fb00df54 100644
|
| --- a/src/scopes.cc
|
| +++ b/src/scopes.cc
|
| @@ -366,17 +366,22 @@ Variable* Scope::DeclareFunctionVar(Handle<String> name) {
|
| }
|
|
|
|
|
| -Variable* Scope::DeclareLocal(Handle<String> name,
|
| - Variable::Mode mode,
|
| - LocalType type) {
|
| - // DYNAMIC variables are introduces during variable allocation,
|
| - // INTERNAL variables are allocated explicitly, and TEMPORARY
|
| - // variables are allocated via NewTemporary().
|
| +void Scope::DeclareParameter(Handle<String> name) {
|
| ASSERT(!resolved());
|
| + ASSERT(is_function_scope());
|
| + Variable* var =
|
| + variables_.Declare(this, name, Variable::VAR, true, Variable::NORMAL);
|
| + params_.Add(var);
|
| +}
|
| +
|
| +
|
| +Variable* Scope::DeclareLocal(Handle<String> name, Variable::Mode mode) {
|
| + ASSERT(!resolved());
|
| + // This function handles VAR and CONST modes. DYNAMIC variables are
|
| + // introduces during variable allocation, INTERNAL variables are allocated
|
| + // explicitly, and TEMPORARY variables are allocated via NewTemporary().
|
| ASSERT(mode == Variable::VAR || mode == Variable::CONST);
|
| - if (type == VAR_OR_CONST) {
|
| - num_var_or_const_++;
|
| - }
|
| + ++num_var_or_const_;
|
| return variables_.Declare(this, name, mode, true, Variable::NORMAL);
|
| }
|
|
|
| @@ -388,13 +393,6 @@ Variable* Scope::DeclareGlobal(Handle<String> name) {
|
| }
|
|
|
|
|
| -void Scope::AddParameter(Variable* var) {
|
| - ASSERT(is_function_scope());
|
| - ASSERT(LocalLookup(var->name()) == var);
|
| - params_.Add(var);
|
| -}
|
| -
|
| -
|
| VariableProxy* Scope::NewUnresolved(Handle<String> name,
|
| bool inside_with,
|
| int position) {
|
|
|