Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index c3928a7703a6f3bd5c37661d888d404be5e93b8f..4d7ea1f47a445e1fe08534497cb9f9e77c556171 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -223,8 +223,18 @@ Object* DeclareLookupSlot(Isolate* isolate, Handle<String> name, |
int index; |
PropertyAttributes attributes; |
- ContextLookupFlags flags = DONT_FOLLOW_CHAINS; |
+ ContextLookupFlags flags; |
BindingFlags binding_flags; |
+ |
+ // Check for a conflict with a lexically scoped variable |
+ flags = LEXICAL_TEST; |
adamk
2015/10/05 17:20:36
Rather than re-assignining this variable it seems
Dan Ehrenberg
2015/10/08 23:01:26
Done
|
+ context_arg->Lookup(name, flags, &index, &attributes, &binding_flags); |
adamk
2015/10/05 17:20:36
It seems a shame to do this extra context chain wa
Dan Ehrenberg
2015/10/08 23:01:26
Done
|
+ if (attributes != ABSENT && (binding_flags == MUTABLE_CHECK_INITIALIZED || |
+ binding_flags == IMMUTABLE_CHECK_INITIALIZED)) { |
+ return ThrowRedeclarationError(isolate, name); |
+ } |
+ |
+ flags = DONT_FOLLOW_CHAINS; |
Handle<Object> holder = |
context->Lookup(name, flags, &index, &attributes, &binding_flags); |
if (holder.is_null()) { |