mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
commit
a28b5cb438
1 changed files with 8 additions and 1 deletions
|
@ -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.
|
||||
|
@ -148,7 +155,7 @@ pub unsafe fn create_noncallback_interface_object(
|
|||
rval: MutableHandleObject) {
|
||||
create_object(cx,
|
||||
proto,
|
||||
&*(class as *const _ as *const JSClass),
|
||||
class.as_jsclass(),
|
||||
static_methods,
|
||||
static_properties,
|
||||
constants,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue