Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index a7b5a68da0e0527f68ed08b8945418cc2087a6e1..24c8c14f1ced7a1b8a266342cf287cf81f22b18a 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1197,10 +1197,16 @@ |
!isolate->MayAccess(context, Handle<JSObject>::cast(receiver))) { |
return isolate->factory()->null_value(); |
} |
+ if (receiver->IsJSProxy()) { |
+ return JSProxy::GetPrototype(Handle<JSProxy>::cast(receiver)); |
+ } |
PrototypeIterator iter(isolate, receiver, |
PrototypeIterator::START_AT_RECEIVER); |
do { |
- if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); |
+ iter.AdvanceIgnoringProxies(); |
+ if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) { |
+ return PrototypeIterator::GetCurrent(iter); |
+ } |
} while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); |
return PrototypeIterator::GetCurrent(iter); |
} |