Pass a Reflector to WrapNewBindingObject instead of a Reflectable, and rename it GetReflector.

This commit is contained in:
Ms2ger 2013-11-03 12:15:11 +01:00
parent 9d8c97d3b0
commit 4074412107
2 changed files with 8 additions and 23 deletions

View file

@ -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]