| Index: src/ast/scopes.cc
|
| diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
|
| index c49d60400a168ea1167b1114e86da003cbe47764..8808449be2a1a0da4b0eff767e0b1b339299ec60 100644
|
| --- a/src/ast/scopes.cc
|
| +++ b/src/ast/scopes.cc
|
| @@ -335,11 +335,9 @@ void Scope::DeserializeScopeInfo(Isolate* isolate,
|
| if (scope_info_->HasFunctionName()) {
|
| Handle<String> name_handle(scope_info_->FunctionName(), isolate);
|
| const AstRawString* name = ast_value_factory->GetString(name_handle);
|
| - VariableMode mode;
|
| - int index = scope_info_->FunctionContextSlotIndex(*name_handle, &mode);
|
| + int index = scope_info_->FunctionContextSlotIndex(*name_handle);
|
| if (index >= 0) {
|
| Variable* result = AsDeclarationScope()->DeclareFunctionVar(name);
|
| - DCHECK_EQ(mode, result->mode());
|
| result->AllocateTo(VariableLocation::CONTEXT, index);
|
| }
|
| }
|
| @@ -428,9 +426,11 @@ void DeclarationScope::DeclareDefaultFunctionVariables(
|
| Variable* DeclarationScope::DeclareFunctionVar(const AstRawString* name) {
|
| DCHECK(is_function_scope());
|
| DCHECK_NULL(function_);
|
| - VariableMode mode = is_strict(language_mode()) ? CONST : CONST_LEGACY;
|
| - function_ = new (zone())
|
| - Variable(this, name, mode, Variable::NORMAL, kCreatedInitialized);
|
| + Variable::Kind kind = is_sloppy(language_mode())
|
| + ? Variable::SLOPPY_FUNCTION_NAME
|
| + : Variable::NORMAL;
|
| + function_ =
|
| + new (zone()) Variable(this, name, CONST, kind, kCreatedInitialized);
|
| return function_;
|
| }
|
|
|
| @@ -605,11 +605,9 @@ Variable* DeclarationScope::LookupFunctionVar(const AstRawString* name) {
|
| return function_;
|
| } else if (!scope_info_.is_null()) {
|
| // If we are backed by a scope info, try to lookup the variable there.
|
| - VariableMode mode;
|
| - int index = scope_info_->FunctionContextSlotIndex(*(name->string()), &mode);
|
| + int index = scope_info_->FunctionContextSlotIndex(*(name->string()));
|
| if (index < 0) return nullptr;
|
| Variable* var = DeclareFunctionVar(name);
|
| - DCHECK_EQ(mode, var->mode());
|
| var->AllocateTo(VariableLocation::CONTEXT, index);
|
| return var;
|
| } else {
|
|
|