mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix prototypes of interface objects (fixes #2665)
This commit is contained in:
parent
a1a9021aad
commit
d13da7d9b3
10 changed files with 77 additions and 372 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue