diff --git a/src/objects.cc b/src/objects.cc index 87853f3805..a30d6ab0d1 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -1976,12 +1976,11 @@ void JSObject::EnqueueChangeRecord(Handle object, const char* type_str, Handle name, Handle old_value) { + ASSERT(!object->IsJSGlobalProxy()); + ASSERT(!object->IsJSGlobalObject()); Isolate* isolate = object->GetIsolate(); HandleScope scope(isolate); Handle type = isolate->factory()->InternalizeUtf8String(type_str); - if (object->IsJSGlobalObject()) { - object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate); - } Handle args[] = { type, object, name, old_value }; int argc = name.is_null() ? 2 : old_value->IsTheHole() ? 3 : 4; @@ -5927,6 +5926,8 @@ MaybeHandle JSObject::Freeze(Handle object) { void JSObject::SetObserved(Handle object) { + ASSERT(!object->IsJSGlobalProxy()); + ASSERT(!object->IsJSGlobalObject()); Isolate* isolate = object->GetIsolate(); Handle new_map; Handle old_map(object->map(), isolate); diff --git a/src/runtime.cc b/src/runtime.cc index e07876b84b..e5df51e2e1 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -14883,12 +14883,7 @@ RUNTIME_FUNCTION(Runtime_IsObserved) { if (!args[0]->IsJSReceiver()) return isolate->heap()->false_value(); CONVERT_ARG_CHECKED(JSReceiver, obj, 0); - if (obj->IsJSGlobalProxy()) { - Object* proto = obj->GetPrototype(); - if (proto->IsNull()) return isolate->heap()->false_value(); - ASSERT(proto->IsJSGlobalObject()); - obj = JSReceiver::cast(proto); - } + ASSERT(!obj->IsJSGlobalProxy() || !obj->map()->is_observed()); return isolate->heap()->ToBoolean(obj->map()->is_observed()); } @@ -14897,12 +14892,7 @@ RUNTIME_FUNCTION(Runtime_SetIsObserved) { HandleScope scope(isolate); ASSERT(args.length() == 1); CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); - if (obj->IsJSGlobalProxy()) { - Object* proto = obj->GetPrototype(); - if (proto->IsNull()) return isolate->heap()->undefined_value(); - ASSERT(proto->IsJSGlobalObject()); - obj = handle(JSReceiver::cast(proto)); - } + ASSERT(!obj->IsJSGlobalProxy()); if (obj->IsJSProxy()) return isolate->heap()->undefined_value();