mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Pass &JS<Window> to the Wrap functions in codegen.
This commit is contained in:
parent
23b7277b54
commit
787108deaf
5 changed files with 12 additions and 12 deletions
|
@ -32,11 +32,10 @@ impl <T> Clone for JS<T> {
|
|||
impl<T: Reflectable> JS<T> {
|
||||
pub fn new(mut obj: ~T,
|
||||
window: &JS<Window>,
|
||||
wrap_fn: extern "Rust" fn(*JSContext, *JSObject, ~T) -> *JSObject) -> JS<T> {
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JS<Window>, ~T) -> *JSObject) -> JS<T> {
|
||||
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() {
|
||||
if wrap_fn(cx, window, obj).is_null() {
|
||||
fail!("Could not eagerly wrap object");
|
||||
}
|
||||
JS {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue