Index: src/json-stringifier.h |
diff --git a/src/json-stringifier.h b/src/json-stringifier.h |
index 0a453ef67f6d6404d714cf13e6a29a011014b426..ba4c87ad1d5f14b8b64f99608e3fa4a0d9fc671f 100644 |
--- a/src/json-stringifier.h |
+++ b/src/json-stringifier.h |
@@ -631,8 +631,9 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject( |
Result stack_push = StackPush(object); |
if (stack_push != SUCCESS) return stack_push; |
if (object->IsJSGlobalProxy()) { |
- object = Handle<JSObject>( |
- JSObject::cast(object->GetPrototype()), isolate_); |
+ // TODO(verwaest): This will crash if the global proxy is detached. |
+ PrototypeIterator iter(isolate_, object); |
+ object = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); |
ASSERT(object->IsGlobalObject()); |
} |