diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-02-16 00:39:26 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-02-23 15:42:43 +0100 |
commit | 144e21554820cf9638ceff76f89b35f6f1a346e0 (patch) | |
tree | dc31cb0403878e7984ec21e378d2929e88e94821 /components/script/dom/browsingcontext.rs | |
parent | a734b8fa214d763f69a0a4ddffc91a71c9483ad0 (diff) | |
download | servo-144e21554820cf9638ceff76f89b35f6f1a346e0.tar.gz servo-144e21554820cf9638ceff76f89b35f6f1a346e0.zip |
Don't use the hasOwn hook anymore in browsingcontext
There is no [[HasOwnProperty]] hook in the ES spec, we should just define
the has proxy trap.
https://bugzilla.mozilla.org/show_bug.cgi?id=980565
Diffstat (limited to 'components/script/dom/browsingcontext.rs')
-rw-r--r-- | components/script/dom/browsingcontext.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index 2805d271636..7149a365800 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -16,10 +16,10 @@ use js::JSCLASS_IS_GLOBAL; use js::glue::{CreateWrapperProxyHandler, GetProxyPrivate, NewWindowProxy}; use js::glue::{ProxyTraps, SetProxyExtra}; use js::jsapi::{Handle, HandleId, HandleObject, JSAutoCompartment, JSAutoRequest, JSContext}; -use js::jsapi::{JSErrNum, JSObject, JSPropertyDescriptor, JS_AlreadyHasOwnPropertyById}; -use js::jsapi::{JS_DefinePropertyById6, JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo}; -use js::jsapi::{JS_GetClass, JS_GetOwnPropertyDescriptorById, MutableHandle, MutableHandleValue}; -use js::jsapi::{ObjectOpResult, RootedObject, RootedValue}; +use js::jsapi::{JSErrNum, JSObject, JSPropertyDescriptor, JS_DefinePropertyById6}; +use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass}; +use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, MutableHandle}; +use js::jsapi::{MutableHandleValue, ObjectOpResult, RootedObject, RootedValue}; use js::jsval::{ObjectValue, PrivateValue, UndefinedValue}; #[dom_struct] @@ -176,11 +176,11 @@ unsafe extern "C" fn defineProperty(cx: *mut JSContext, } #[allow(unsafe_code)] -unsafe extern "C" fn hasOwn(cx: *mut JSContext, - proxy: HandleObject, - id: HandleId, - bp: *mut bool) - -> bool { +unsafe extern "C" fn has(cx: *mut JSContext, + proxy: HandleObject, + id: HandleId, + bp: *mut bool) + -> bool { let window = GetSubframeWindow(cx, proxy, id); if window.is_some() { *bp = true; @@ -189,7 +189,7 @@ unsafe extern "C" fn hasOwn(cx: *mut JSContext, let target = RootedObject::new(cx, GetProxyPrivate(*proxy.ptr).to_object()); let mut found = false; - if !JS_AlreadyHasOwnPropertyById(cx, target.handle(), id, &mut found) { + if !JS_HasPropertyById(cx, target.handle(), id, &mut found) { return false; } @@ -247,13 +247,13 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps { enumerate: None, preventExtensions: None, isExtensible: None, - has: None, + has: Some(has), get: Some(get), set: Some(set), call: None, construct: None, getPropertyDescriptor: Some(get_property_descriptor), - hasOwn: Some(hasOwn), + hasOwn: None, getOwnEnumerablePropertyKeys: None, nativeCall: None, hasInstance: None, |