Make create_global_object take a &'static Class

This commit is contained in:
Anthony Ramine 2016-08-24 20:37:19 +02:00
parent a4f2159e36
commit 5f59bb2e0c
2 changed files with 2 additions and 2 deletions

View file

@ -2516,7 +2516,7 @@ let _rt = RootedTraceable::new(&*raw);
rooted!(in(cx) let obj = rooted!(in(cx) let obj =
create_global_object( create_global_object(
cx, cx,
&Class.base as *const js::jsapi::Class as *const _, &*(&Class.base as *const js::jsapi::Class as *const _),
raw as *const libc::c_void, raw as *const libc::c_void,
_trace)); _trace));
assert!(!obj.is_null()); assert!(!obj.is_null());

View file

@ -216,7 +216,7 @@ pub type TraceHook =
/// Create a global object with the given class. /// Create a global object with the given class.
pub unsafe fn create_global_object( pub unsafe fn create_global_object(
cx: *mut JSContext, cx: *mut JSContext,
class: *const JSClass, class: &'static JSClass,
private: *const libc::c_void, private: *const libc::c_void,
trace: TraceHook) trace: TraceHook)
-> *mut JSObject { -> *mut JSObject {