Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index c92f027264ce3edc2974d269eb2dc8cd91f2b083..7a523a7cac41b3783be5f99f381f313d76cdb3fa 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -240,12 +240,17 @@ RUNTIME_FUNCTION(Runtime_DeclareLookupSlot) { |
// TODO(verwaest): This case should probably not be covered by this function, |
// but by DeclareGlobals instead. |
- if ((attributes != ABSENT && holder->IsJSGlobalObject()) || |
- (context_arg->has_extension() && |
- context_arg->extension()->IsJSGlobalObject())) { |
+ if (attributes != ABSENT && holder->IsJSGlobalObject()) { |
return DeclareGlobals(isolate, Handle<JSGlobalObject>::cast(holder), name, |
value, attr, is_var, is_const, is_function); |
} |
+ if (context_arg->has_extension() && |
+ context_arg->extension()->IsJSGlobalObject()) { |
+ Handle<JSGlobalObject> global( |
+ JSGlobalObject::cast(context_arg->extension()), isolate); |
+ return DeclareGlobals(isolate, global, name, value, attr, is_var, is_const, |
+ is_function); |
+ } |
if (attributes != ABSENT) { |
// The name was declared before; check for conflicting re-declarations. |