Remove WrapNativeParent and nearby cleanup.

This commit is contained in:
Ms2ger 2013-11-03 14:47:26 +01:00
parent 5c101526a1
commit edd9c1d5eb
3 changed files with 19 additions and 38 deletions

View file

@ -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;
}
@ -592,18 +594,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 {