Added is_platform_object_static check to is_dom_object

This commit is contained in:
Sean Joseph 2020-11-26 18:40:41 -05:00
parent 823cca30d6
commit 9e22804983

View file

@ -5,6 +5,7 @@
use crate::dom::bindings::codegen::RegisterBindings; use crate::dom::bindings::codegen::RegisterBindings;
use crate::dom::bindings::conversions::is_dom_proxy; use crate::dom::bindings::conversions::is_dom_proxy;
use crate::dom::bindings::proxyhandler; use crate::dom::bindings::proxyhandler;
use crate::dom::bindings::utils::is_platform_object_static;
use crate::script_runtime::JSEngineSetup; use crate::script_runtime::JSEngineSetup;
use js::jsapi::JSObject; use js::jsapi::JSObject;
@ -53,7 +54,7 @@ fn perform_platform_specific_initialization() {}
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe extern "C" fn is_dom_object(obj: *mut JSObject) -> bool { unsafe extern "C" fn is_dom_object(obj: *mut JSObject) -> bool {
!obj.is_null() && is_dom_proxy(obj) !obj.is_null() && (is_platform_object_static(obj) || is_dom_proxy(obj))
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]