mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Pass a Reflector to WrapNewBindingObject instead of a Reflectable, and rename it GetReflector.
This commit is contained in:
parent
9d8c97d3b0
commit
4074412107
2 changed files with 8 additions and 23 deletions
|
@ -583,16 +583,14 @@ impl Reflector {
|
|||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn WrapNewBindingObject(cx: *JSContext, _scope: *JSObject,
|
||||
value: @mut Reflectable,
|
||||
vp: *mut JSVal) -> JSBool {
|
||||
unsafe {
|
||||
let reflector = value.mut_reflector();
|
||||
pub fn GetReflector(cx: *JSContext, reflector: &Reflector,
|
||||
vp: *mut JSVal) -> JSBool {
|
||||
let obj = reflector.get_jsobject();
|
||||
assert!(obj.is_not_null());
|
||||
*vp = RUST_OBJECT_TO_JSVAL(obj);
|
||||
return JS_WrapValue(cx, cast::transmute(vp));
|
||||
}
|
||||
unsafe {
|
||||
*vp = RUST_OBJECT_TO_JSVAL(obj);
|
||||
return JS_WrapValue(cx, cast::transmute(vp));
|
||||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue