mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Simplify Window wrapping.
This commit is contained in:
parent
5626846d7c
commit
4910a23803
1 changed files with 3 additions and 5 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue