Auto merge of #9296 - apopiak:implement_as_class_9287, r=ecoal95

implement NonCallbackInterfaceObjectClass::as_jsclass()

close #9287

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9296)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-01-14 18:24:03 +05:30
commit a28b5cb438

View file

@ -105,6 +105,13 @@ impl NonCallbackInterfaceObjectClass {
}, },
} }
} }
/// cast own reference to `JSClass` reference
pub fn as_jsclass(&self) -> &JSClass {
unsafe {
&*(self as *const _ as *const JSClass)
}
}
} }
/// Create and define the interface object of a callback interface. /// Create and define the interface object of a callback interface.
@ -148,7 +155,7 @@ pub unsafe fn create_noncallback_interface_object(
rval: MutableHandleObject) { rval: MutableHandleObject) {
create_object(cx, create_object(cx,
proto, proto,
&*(class as *const _ as *const JSClass), class.as_jsclass(),
static_methods, static_methods,
static_properties, static_properties,
constants, constants,