mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Remove NonNullJSNative
This commit is contained in:
parent
51e46b11a3
commit
86996fdf83
2 changed files with 4 additions and 8 deletions
|
@ -2817,13 +2817,13 @@ assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
|
||||||
|
|
||||||
constructors = self.descriptor.interface.namedConstructors
|
constructors = self.descriptor.interface.namedConstructors
|
||||||
if constructors:
|
if constructors:
|
||||||
decl = "let named_constructors: [(NonNullJSNative, &'static [u8], u32); %d]" % len(constructors)
|
decl = "let named_constructors: [(ConstructorClassHook, &'static [u8], u32); %d]" % len(constructors)
|
||||||
specs = []
|
specs = []
|
||||||
for constructor in constructors:
|
for constructor in constructors:
|
||||||
hook = CONSTRUCT_HOOK_NAME + "_" + constructor.identifier.name
|
hook = CONSTRUCT_HOOK_NAME + "_" + constructor.identifier.name
|
||||||
name = str_to_const_array(constructor.identifier.name)
|
name = str_to_const_array(constructor.identifier.name)
|
||||||
length = methodLength(constructor)
|
length = methodLength(constructor)
|
||||||
specs.append(CGGeneric("(%s as NonNullJSNative, %s, %d)" % (hook, name, length)))
|
specs.append(CGGeneric("(%s as ConstructorClassHook, %s, %d)" % (hook, name, length)))
|
||||||
values = CGIndenter(CGList(specs, "\n"), 4)
|
values = CGIndenter(CGList(specs, "\n"), 4)
|
||||||
code.append(CGWrapper(values, pre="%s = [\n" % decl, post="\n];"))
|
code.append(CGWrapper(values, pre="%s = [\n" % decl, post="\n];"))
|
||||||
code.append(CGGeneric("create_named_constructors(cx, global, &named_constructors, prototype.handle());"))
|
code.append(CGGeneric("create_named_constructors(cx, global, &named_constructors, prototype.handle());"))
|
||||||
|
@ -5434,9 +5434,9 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'dom::bindings::global::GlobalRef',
|
'dom::bindings::global::GlobalRef',
|
||||||
'dom::bindings::global::global_root_from_object',
|
'dom::bindings::global::global_root_from_object',
|
||||||
'dom::bindings::global::global_root_from_reflector',
|
'dom::bindings::global::global_root_from_reflector',
|
||||||
|
'dom::bindings::interface::ConstructorClassHook',
|
||||||
'dom::bindings::interface::InterfaceConstructorBehavior',
|
'dom::bindings::interface::InterfaceConstructorBehavior',
|
||||||
'dom::bindings::interface::NonCallbackInterfaceObjectClass',
|
'dom::bindings::interface::NonCallbackInterfaceObjectClass',
|
||||||
'dom::bindings::interface::NonNullJSNative',
|
|
||||||
'dom::bindings::interface::create_callback_interface_object',
|
'dom::bindings::interface::create_callback_interface_object',
|
||||||
'dom::bindings::interface::create_global_object',
|
'dom::bindings::interface::create_global_object',
|
||||||
'dom::bindings::interface::create_interface_prototype_object',
|
'dom::bindings::interface::create_interface_prototype_object',
|
||||||
|
|
|
@ -30,10 +30,6 @@ use js::rust::{define_methods, define_properties};
|
||||||
use libc;
|
use libc;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
/// A JSNative that cannot be null.
|
|
||||||
pub type NonNullJSNative =
|
|
||||||
unsafe extern "C" fn (arg1: *mut JSContext, arg2: libc::c_uint, arg3: *mut JSVal) -> bool;
|
|
||||||
|
|
||||||
unsafe extern "C" fn fun_to_string_hook(cx: *mut JSContext,
|
unsafe extern "C" fn fun_to_string_hook(cx: *mut JSContext,
|
||||||
obj: HandleObject,
|
obj: HandleObject,
|
||||||
_indent: u32)
|
_indent: u32)
|
||||||
|
@ -261,7 +257,7 @@ pub unsafe fn create_noncallback_interface_object(
|
||||||
pub unsafe fn create_named_constructors(
|
pub unsafe fn create_named_constructors(
|
||||||
cx: *mut JSContext,
|
cx: *mut JSContext,
|
||||||
global: HandleObject,
|
global: HandleObject,
|
||||||
named_constructors: &[(NonNullJSNative, &[u8], u32)],
|
named_constructors: &[(ConstructorClassHook, &[u8], u32)],
|
||||||
interface_prototype_object: HandleObject) {
|
interface_prototype_object: HandleObject) {
|
||||||
rooted!(in(cx) let mut constructor = ptr::null_mut());
|
rooted!(in(cx) let mut constructor = ptr::null_mut());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue