mirror of
https://github.com/servo/servo.git
synced 2025-10-18 17:29:18 +01:00
Fill out various proxy binding traps as part of making setters work. Add named getter and setter and indexed getter support, as well as proxy object expandos. Fixes #660.
This commit is contained in:
parent
a4baa7fc6b
commit
c9bc2046f6
10 changed files with 376 additions and 48 deletions
|
@ -120,7 +120,7 @@ fn is_dom_class(clasp: *JSClass) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_dom_proxy(obj: *JSObject) -> bool {
|
||||
pub fn is_dom_proxy(obj: *JSObject) -> bool {
|
||||
unsafe {
|
||||
(js_IsObjectProxyClass(obj) || js_IsFunctionProxyClass(obj)) &&
|
||||
IsProxyHandlerFamily(obj)
|
||||
|
@ -888,3 +888,9 @@ pub fn FindEnumStringIndex(cx: *JSContext,
|
|||
return Err(()); //XXX pass in behaviour for value not found
|
||||
}
|
||||
}
|
||||
|
||||
pub fn HasPropertyOnPrototype(cx: *JSContext, proxy: *JSObject, id: jsid) -> bool {
|
||||
// MOZ_ASSERT(js::IsProxy(proxy) && js::GetProxyHandler(proxy) == handler);
|
||||
let mut found = false;
|
||||
return !GetPropertyOnPrototype(cx, proxy, id, &mut found, ptr::null()) || found;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue