Pass &JS<Window> to reflect_dom_object.

This commit is contained in:
Ms2ger 2014-03-04 14:13:58 +01:00
parent 6291aac170
commit 23b7277b54
23 changed files with 26 additions and 26 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::utils::{Reflector, Reflectable};
use dom::window;
use dom::window::Window;
use js::jsapi::{JSContext, JSObject};
use layout_interface::TrustedNodeAddress;
@ -31,10 +31,10 @@ impl <T> Clone for JS<T> {
impl<T: Reflectable> JS<T> {
pub fn new(mut obj: ~T,
window: &window::Window,
window: &JS<Window>,
wrap_fn: extern "Rust" fn(*JSContext, *JSObject, ~T) -> *JSObject) -> JS<T> {
let cx = window.get_cx();
let scope = window.reflector().get_jsobject();
let cx = window.get().get_cx();
let scope = window.get().reflector().get_jsobject();
let raw: *mut T = &mut *obj;
if wrap_fn(cx, scope, obj).is_null() {
fail!("Could not eagerly wrap object");