mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
Use u32 for reserved slot indices.
This is what the JSAPI expects.
This commit is contained in:
parent
03408d69fb
commit
21a1143dd1
2 changed files with 5 additions and 5 deletions
|
@ -1855,7 +1855,7 @@ assert!(!obj.is_null());\
|
||||||
create += """\
|
create += """\
|
||||||
assert!(!obj.is_null());
|
assert!(!obj.is_null());
|
||||||
|
|
||||||
JS_SetReservedSlot(obj, DOM_OBJECT_SLOT as u32,
|
JS_SetReservedSlot(obj, DOM_OBJECT_SLOT,
|
||||||
PrivateValue(boxed::into_raw(object) as *const libc::c_void));"""
|
PrivateValue(boxed::into_raw(object) as *const libc::c_void));"""
|
||||||
return create
|
return create
|
||||||
|
|
||||||
|
|
|
@ -410,8 +410,8 @@ pub fn is_dom_proxy(obj: *mut JSObject) -> bool {
|
||||||
/// stored for non-proxy bindings.
|
/// stored for non-proxy bindings.
|
||||||
// We use slot 0 for holding the raw object. This is safe for both
|
// We use slot 0 for holding the raw object. This is safe for both
|
||||||
// globals and non-globals.
|
// globals and non-globals.
|
||||||
pub const DOM_OBJECT_SLOT: uint = 0;
|
pub const DOM_OBJECT_SLOT: u32 = 0;
|
||||||
const DOM_PROXY_OBJECT_SLOT: uint = js::JSSLOT_PROXY_PRIVATE as uint;
|
const DOM_PROXY_OBJECT_SLOT: u32 = js::JSSLOT_PROXY_PRIVATE;
|
||||||
|
|
||||||
/// Returns the index of the slot wherein a pointer to the reflected DOM object
|
/// Returns the index of the slot wherein a pointer to the reflected DOM object
|
||||||
/// is stored.
|
/// is stored.
|
||||||
|
@ -420,10 +420,10 @@ const DOM_PROXY_OBJECT_SLOT: uint = js::JSSLOT_PROXY_PRIVATE as uint;
|
||||||
pub unsafe fn dom_object_slot(obj: *mut JSObject) -> u32 {
|
pub unsafe fn dom_object_slot(obj: *mut JSObject) -> u32 {
|
||||||
let clasp = JS_GetClass(obj);
|
let clasp = JS_GetClass(obj);
|
||||||
if is_dom_class(&*clasp) {
|
if is_dom_class(&*clasp) {
|
||||||
DOM_OBJECT_SLOT as u32
|
DOM_OBJECT_SLOT
|
||||||
} else {
|
} else {
|
||||||
assert!(is_dom_proxy(obj));
|
assert!(is_dom_proxy(obj));
|
||||||
DOM_PROXY_OBJECT_SLOT as u32
|
DOM_PROXY_OBJECT_SLOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue