diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-12-13 09:00:26 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-01-12 17:15:44 +0100 |
commit | d13da7d9b30a6671ed45e2f2c290405a5c92aafe (patch) | |
tree | f7b8bd2c5fdb6d14e1673613b8bfbcf09512c4de /components/script/dom/bindings/interface.rs | |
parent | a1a9021aad90cdc06816341b951e9d2fedaa43ee (diff) | |
download | servo-d13da7d9b30a6671ed45e2f2c290405a5c92aafe.tar.gz servo-d13da7d9b30a6671ed45e2f2c290405a5c92aafe.zip |
Fix prototypes of interface objects (fixes #2665)
Diffstat (limited to 'components/script/dom/bindings/interface.rs')
-rw-r--r-- | components/script/dom/bindings/interface.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs index 4066e5617cb..96f4d7c470a 100644 --- a/components/script/dom/bindings/interface.rs +++ b/components/script/dom/bindings/interface.rs @@ -144,20 +144,19 @@ pub unsafe fn create_noncallback_interface_object( constants: &'static [ConstantSpec], interface_prototype_object: HandleObject, name: &'static [u8], - length: u32) { - let mut interface_object = RootedObject::new(cx, ptr::null_mut()); + length: u32, + rval: MutableHandleObject) { create_object(cx, proto, &*(class as *const _ as *const JSClass), static_methods, static_properties, constants, - interface_object.handle_mut()); - assert!(JS_LinkConstructorAndPrototype(cx, interface_object.handle(), - interface_prototype_object)); - define_name(cx, interface_object.handle(), name); - define_length(cx, interface_object.handle(), length); - define_on_global_object(cx, receiver, name, interface_object.handle()); + rval); + assert!(JS_LinkConstructorAndPrototype(cx, rval.handle(), interface_prototype_object)); + define_name(cx, rval.handle(), name); + define_length(cx, rval.handle(), length); + define_on_global_object(cx, receiver, name, rval.handle()); } /// Create and define the named constructors of a non-callback interface. |