Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index 2a2ab16d45ef357e928d49387042a8214caed154..7d4392e834a5337974dac2ce5098b09fb770fd4a 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -239,12 +239,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()) { |
Toon Verwaest
2015/04/20 10:59:14
If the holder is a JSGlobalObject, shouldn't it ==
wingo
2015/04/20 11:23:18
Thanks for looking into this. I think the issue I
|
+ 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. |