Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 8406a6ad681bfa33e6a7cc0a449d2f40b5b0d3db..02e3160c9364326c0d027ad1c8a57873319a27fa 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -5907,16 +5907,13 @@ PropertyAttributes JSReceiver::GetElementAttribute(uint32_t index) { |
} |
-// TODO(504): this may be useful in other places too where JSGlobalProxy |
-// is used. |
-Object* JSObject::BypassGlobalProxy() { |
- if (IsJSGlobalProxy()) { |
- Object* proto = GetPrototype(); |
- if (proto->IsNull()) return GetHeap()->undefined_value(); |
- ASSERT(proto->IsJSGlobalObject()); |
- return proto; |
- } |
- return this; |
+bool JSGlobalObject::IsDetached() { |
+ return JSGlobalProxy::cast(global_receiver())->IsDetachedFrom(this); |
+} |
+ |
+ |
+bool JSGlobalProxy::IsDetachedFrom(GlobalObject* global) { |
+ return GetPrototype() != global; |
} |