Replace GetReflector by an implementation of ToJSValConvertible.

This commit is contained in:
Ms2ger 2014-03-10 17:08:06 +01:00
parent d004e43331
commit 256a5cbf9f
3 changed files with 20 additions and 48 deletions

View file

@ -21,7 +21,7 @@ use std::unstable::raw::Box;
use js::glue::*;
use js::glue::{js_IsObjectProxyClass, js_IsFunctionProxyClass, IsProxyHandlerFamily};
use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewFunction};
use js::jsapi::{JS_DefineProperties, JS_WrapValue, JS_ForwardGetPropertyTo};
use js::jsapi::{JS_DefineProperties, JS_ForwardGetPropertyTo};
use js::jsapi::{JS_GetClass, JS_LinkConstructorAndPrototype, JS_GetStringCharsAndLength};
use js::jsapi::{JS_ObjectIsRegExp, JS_ObjectIsDate};
use js::jsapi::{JS_InternString, JS_GetFunctionObject};
@ -460,16 +460,6 @@ impl Reflector {
}
}
pub fn GetReflector(cx: *JSContext, reflector: &Reflector,
vp: *mut JSVal) -> JSBool {
let obj = reflector.get_jsobject();
assert!(obj.is_not_null());
unsafe {
*vp = ObjectValue(&*obj);
return JS_WrapValue(cx, cast::transmute(vp));
}
}
pub fn GetPropertyOnPrototype(cx: *JSContext, proxy: *JSObject, id: jsid, found: *mut bool,
vp: *JSVal) -> bool {
unsafe {