Index: src/scopes.cc |
diff --git a/src/scopes.cc b/src/scopes.cc |
index 9672bd6642a6c6cbb3bf6101b174de8749695042..7ce5f1dc51816b809a415e1b3f1b771373d6e12b 100644 |
--- a/src/scopes.cc |
+++ b/src/scopes.cc |
@@ -378,7 +378,7 @@ Variable* Scope::LocalLookup(Handle<String> name) { |
index = scope_info_->ParameterIndex(*name); |
if (index < 0) { |
// Check the function name. |
- index = scope_info_->FunctionContextSlotIndex(*name); |
+ index = scope_info_->FunctionContextSlotIndex(*name, NULL); |
if (index < 0) return NULL; |
} |
} |
@@ -401,10 +401,10 @@ Variable* Scope::Lookup(Handle<String> name) { |
} |
-Variable* Scope::DeclareFunctionVar(Handle<String> name) { |
+Variable* Scope::DeclareFunctionVar(Handle<String> name, VariableMode mode) { |
ASSERT(is_function_scope() && function_ == NULL); |
Variable* function_var = |
- new Variable(this, name, CONST, true, Variable::NORMAL); |
+ new Variable(this, name, mode, true, Variable::NORMAL); |
function_ = new(isolate_->zone()) VariableProxy(isolate_, function_var); |
return function_var; |
} |
@@ -424,7 +424,10 @@ Variable* Scope::DeclareLocal(Handle<String> name, VariableMode mode) { |
// 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 == VAR || mode == CONST || mode == LET); |
+ ASSERT(mode == VAR || |
+ mode == CONST || |
+ mode == CONST_HARMONY || |
+ mode == LET); |
++num_var_or_const_; |
return variables_.Declare(this, name, mode, true, Variable::NORMAL); |
} |