diff options
Diffstat (limited to 'src/components/script/dom/bindings/utils.rs')
-rw-r--r-- | src/components/script/dom/bindings/utils.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 2754d6261a0..9f258c2424f 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -18,7 +18,7 @@ use std::unstable::raw::Box; use js::glue::*; use js::glue::{DefineFunctionWithReserved, GetObjectJSClass, RUST_OBJECT_TO_JSVAL}; use js::glue::{js_IsObjectProxyClass, js_IsFunctionProxyClass, IsProxyHandlerFamily}; -use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewObject, JS_NewFunction, JS_GetGlobalObject}; +use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewObject, JS_NewFunction}; use js::jsapi::{JS_DefineProperties, JS_WrapValue, JS_ForwardGetPropertyTo}; use js::jsapi::{JS_GetClass, JS_LinkConstructorAndPrototype, JS_GetStringCharsAndLength}; use js::jsapi::{JS_ObjectIsRegExp, JS_ObjectIsDate}; @@ -567,6 +567,8 @@ impl Reflector { } pub fn set_jsobject(&mut self, object: *JSObject) { + assert!(self.object.is_null()); + assert!(object.is_not_null()); self.object = object; } @@ -593,18 +595,6 @@ pub fn GetReflector(cx: *JSContext, reflector: &Reflector, } #[fixed_stack_segment] -pub fn WrapNativeParent(cx: *JSContext, _scope: *JSObject, mut p: Option<@mut Reflectable>) -> *JSObject { - match p { - Some(ref mut p) => { - let obj = p.reflector().get_jsobject(); - assert!(obj.is_not_null()); - obj - } - None => unsafe { JS_GetGlobalObject(cx) } - } -} - -#[fixed_stack_segment] pub fn GetPropertyOnPrototype(cx: *JSContext, proxy: *JSObject, id: jsid, found: *mut bool, vp: *JSVal) -> bool { unsafe { |