Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 2034) |
+++ src/runtime.cc (working copy) |
@@ -5485,7 +5485,8 @@ |
} |
-static Object* DebugLookupResultValue(Object* receiver, LookupResult* result, |
+static Object* DebugLookupResultValue(Object* receiver, String* name, |
+ LookupResult* result, |
bool* caught_exception) { |
Object* value; |
switch (result->type()) { |
@@ -5510,11 +5511,18 @@ |
return result->GetConstantFunction(); |
case CALLBACKS: { |
Object* structure = result->GetCallbackObject(); |
- if (structure->IsProxy()) { |
- AccessorDescriptor* callback = |
- reinterpret_cast<AccessorDescriptor*>( |
- Proxy::cast(structure)->proxy()); |
- value = (callback->getter)(receiver, callback->data); |
+ if (structure->IsProxy() || structure->IsAccessorInfo()) { |
+ if (Debug::debugger_entry()) { |
+ // SaveContext scope. It will restore debugger context after the |
+ // getter execution. |
+ SaveContext save; |
+ Top::set_context(*Debug::debugger_entry()->GetContext()); |
+ value = receiver->GetPropertyWithCallback( |
+ receiver, structure, name, result->holder()); |
+ } else { |
+ value = receiver->GetPropertyWithCallback( |
+ receiver, structure, name, result->holder()); |
+ } |
if (value->IsException()) { |
value = Top::pending_exception(); |
Top::clear_pending_exception(); |
@@ -5595,7 +5603,7 @@ |
if (result.IsProperty()) { |
bool caught_exception = false; |
- Object* value = DebugLookupResultValue(*obj, &result, |
+ Object* value = DebugLookupResultValue(*obj, *name, &result, |
&caught_exception); |
if (value->IsFailure()) return value; |
Handle<Object> value_handle(value); |
@@ -5631,7 +5639,7 @@ |
LookupResult result; |
obj->Lookup(*name, &result); |
if (result.IsProperty()) { |
- return DebugLookupResultValue(*obj, &result, NULL); |
+ return DebugLookupResultValue(*obj, *name, &result, NULL); |
} |
return Heap::undefined_value(); |
} |