| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 1717a5f4b59a8cba4db473b0e0634e9c9c437b93..b41a8d350503f38a588e18bbdaa92404099c3023 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -5891,16 +5891,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;
|
| }
|
|
|
|
|
|
|