diff options
Diffstat (limited to 'src/components/script/dom/bindings/utils.rs')
-rw-r--r-- | src/components/script/dom/bindings/utils.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index a6eb81588df..a441a297aed 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -17,7 +17,6 @@ use std::ptr; use std::ptr::null; use std::str; use std::vec; -use std::raw::Box; use js::glue::*; use js::glue::{js_IsObjectProxyClass, js_IsFunctionProxyClass, IsProxyHandlerFamily}; use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewFunction}; @@ -121,10 +120,10 @@ pub fn unwrap_object<T>(obj: *JSObject, proto_id: PrototypeList::id::ID, proto_d pub fn unwrap_jsmanaged<T: Reflectable>(obj: *JSObject, proto_id: PrototypeList::id::ID, proto_depth: uint) -> Result<JS<T>, ()> { - let result: Result<*mut Box<T>, ()> = unwrap_object(obj, proto_id, proto_depth); + let result: Result<*mut T, ()> = unwrap_object(obj, proto_id, proto_depth); result.map(|unwrapped| { unsafe { - JS::from_box(unwrapped) + JS::from_raw(unwrapped) } }) } @@ -136,10 +135,6 @@ pub fn unwrap_value<T>(val: *JSVal, proto_id: PrototypeList::id::ID, proto_depth } } -pub unsafe fn squirrel_away_unique<T>(x: ~T) -> *Box<T> { - cast::transmute(x) -} - pub unsafe fn squirrel_away_unboxed<T>(x: ~T) -> *T { cast::transmute(x) } @@ -437,7 +432,6 @@ pub fn reflect_dom_object<T: Reflectable> #[deriving(Eq)] pub struct Reflector { object: *JSObject, - force_box_layout: @int, } impl Reflector { @@ -455,7 +449,6 @@ impl Reflector { pub fn new() -> Reflector { Reflector { object: ptr::null(), - force_box_layout: @1, } } } @@ -651,8 +644,8 @@ pub fn global_object_for_js_object(obj: *JSObject) -> JS<window::Window> { let clasp = JS_GetClass(global); assert!(((*clasp).flags & (JSCLASS_IS_DOMJSCLASS | JSCLASS_IS_GLOBAL)) != 0); // FIXME(jdm): Either don't hardcode or sanity assert prototype stuff. - match unwrap_object::<*mut Box<window::Window>>(global, PrototypeList::id::Window, 1) { - Ok(win) => JS::from_box(win), + match unwrap_object::<*mut window::Window>(global, PrototypeList::id::Window, 1) { + Ok(win) => JS::from_raw(win), Err(_) => fail!("found DOM global that doesn't unwrap to Window"), } } |