Update rust

This commit is contained in:
Brian Anderson 2013-09-06 15:04:18 -07:00
parent da4cede500
commit 13a3865e4e
12 changed files with 47 additions and 23 deletions

View file

@ -603,24 +603,24 @@ impl WrapperCache {
#[fixed_stack_segment]
pub fn WrapNewBindingObject(cx: *JSContext, scope: *JSObject,
value: @mut CacheableWrapper,
vp: *mut JSVal) -> bool {
vp: *mut JSVal) -> JSBool {
unsafe {
let cache = value.get_wrappercache();
let obj = cache.get_wrapper();
if obj.is_not_null() /*&& js::GetObjectCompartment(obj) == js::GetObjectCompartment(scope)*/ {
*vp = RUST_OBJECT_TO_JSVAL(obj);
return true;
return 1; // JS_TRUE
}
let obj = value.wrap_object_shared(cx, scope);
if obj.is_null() {
return false;
return 0; // JS_FALSE
}
// MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx));
cache.set_wrapper(obj);
*vp = RUST_OBJECT_TO_JSVAL(obj);
return JS_WrapValue(cx, cast::transmute(vp)) != 0;
return JS_WrapValue(cx, cast::transmute(vp));
}
}