| Index: src/runtime/runtime-scopes.cc
|
| diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
|
| index ff7e783393081cbe731a8d5f265a5b0fa852b773..06f84598438dc0e56761499823696dd8ee962269 100644
|
| --- a/src/runtime/runtime-scopes.cc
|
| +++ b/src/runtime/runtime-scopes.cc
|
| @@ -36,9 +36,7 @@ static Object* DeclareGlobals(Isolate* isolate, Handle<GlobalObject> global,
|
| bool is_const, bool is_function) {
|
| Handle<ScriptContextTable> script_contexts(
|
| global->native_context()->script_context_table());
|
| - ScriptContextTable::LookupResult lookup;
|
| - if (ScriptContextTable::Lookup(script_contexts, name, &lookup) &&
|
| - IsLexicalVariableMode(lookup.mode)) {
|
| + if (ScriptContextTable::LookupLexical(script_contexts, name)) {
|
| return ThrowRedeclarationError(isolate, name);
|
| }
|
|
|
| @@ -624,9 +622,13 @@ static Object* FindNameClash(Handle<ScopeInfo> scope_info,
|
| for (int var = 0; var < scope_info->ContextLocalCount(); var++) {
|
| Handle<String> name(scope_info->ContextLocalName(var));
|
| VariableMode mode = scope_info->ContextLocalMode(var);
|
| - ScriptContextTable::LookupResult lookup;
|
| - if (ScriptContextTable::Lookup(script_context, name, &lookup)) {
|
| - if (IsLexicalVariableMode(mode) || IsLexicalVariableMode(lookup.mode)) {
|
| + if (IsLexicalVariableMode(mode)) {
|
| + ScriptContextTable::LookupResult lookup;
|
| + if (ScriptContextTable::Lookup(script_context, name, &lookup)) {
|
| + return ThrowRedeclarationError(isolate, name);
|
| + }
|
| + } else {
|
| + if (ScriptContextTable::LookupLexical(script_context, name)) {
|
| return ThrowRedeclarationError(isolate, name);
|
| }
|
| }
|
|
|