Simplify Window wrapping.

This commit is contained in:
Ms2ger 2013-11-03 11:16:28 +01:00
parent 5626846d7c
commit 4910a23803

View file

@ -148,8 +148,8 @@ impl Reflectable for Window {
self.eventtarget.mut_reflector()
}
fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
WindowBinding::Wrap(cx, scope, self)
fn wrap_object_shared(@mut self, _cx: *JSContext, _scope: *JSObject) -> *JSObject {
unreachable!()
}
fn GetParentObject(&self, _cx: *JSContext) -> Option<@mut Reflectable> {
@ -229,10 +229,8 @@ impl Window {
next_timer_handle: 0
};
let global = WindowBinding::Wrap(cx, ptr::null(), win);
unsafe {
let reflector = ptr::to_unsafe_ptr(win.reflector());
win.wrap_object_shared(cx, ptr::null()); //XXXjdm proper scope
let global = (*reflector).object;
do "window".to_c_str().with_ref |name| {
JS_DefineProperty(cx, global, name,
RUST_OBJECT_TO_JSVAL(global),