def constructor_context(interface, constructor): arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(constructor, argument) for argument in constructor.arguments) # [RaisesException=Constructor] is_constructor_raises_exception = \ interface.extended_attributes.get('RaisesException') == 'Constructor' return { 'arguments': [v8_methods.argument_context(interface, constructor, argument, index) for index, argument in enumerate(constructor.arguments)], 'arguments_need_try_catch': arguments_need_try_catch, 'cpp_type': cpp_template_type( 'RefPtr', cpp_name(interface)), 'cpp_value': v8_methods.cpp_value( interface, constructor, len(constructor.arguments)), 'has_exception_state': is_constructor_raises_exception or any(argument for argument in constructor.arguments if argument.idl_type.name == 'SerializedScriptValue' or argument.idl_type.may_raise_exception_on_conversion), 'is_call_with_execution_context': # [ConstructorCallWith=ExecutionContext] has_extended_attribute_value(interface, 'ConstructorCallWith', 'ExecutionContext'), 'is_constructor': True, 'is_named_constructor': False, 'is_raises_exception': is_constructor_raises_exception, 'number_of_required_arguments': number_of_required_arguments(constructor), }
def generate_constructor(interface, constructor): arguments_need_try_catch = any( v8_methods.argument_needs_try_catch(argument) for argument in constructor.arguments) return { 'arguments': [ v8_methods.generate_argument(interface, constructor, argument, index) for index, argument in enumerate(constructor.arguments) ], 'arguments_need_try_catch': arguments_need_try_catch, 'cpp_type': cpp_template_type(cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), cpp_name(interface)), 'cpp_value': v8_methods.cpp_value(interface, constructor, len(constructor.arguments)), 'has_exception_state': # [RaisesException=Constructor] interface.extended_attributes.get('RaisesException') == 'Constructor' or any(argument for argument in constructor.arguments if argument.idl_type.name == 'SerializedScriptValue' or argument.idl_type.is_integer_type), 'is_constructor': True, 'is_named_constructor': False, 'number_of_required_arguments': number_of_required_arguments(constructor), }
def constructor_context(interface, constructor): arguments_need_try_catch = any( v8_methods.argument_needs_try_catch(constructor, argument) for argument in constructor.arguments) # [RaisesException=Constructor] is_constructor_raises_exception = \ interface.extended_attributes.get('RaisesException') == 'Constructor' return { 'arguments': [ v8_methods.argument_context(interface, constructor, argument, index) for index, argument in enumerate(constructor.arguments) ], 'arguments_need_try_catch': arguments_need_try_catch, 'cpp_type': cpp_template_type(cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), cpp_name(interface)), 'cpp_value': v8_methods.cpp_value(interface, constructor, len(constructor.arguments)), 'has_exception_state': is_constructor_raises_exception or any(argument for argument in constructor.arguments if argument.idl_type.name == 'SerializedScriptValue' or argument.idl_type.may_raise_exception_on_conversion), 'is_call_with_document': # [ConstructorCallWith=Document] has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document'), 'is_call_with_execution_context': # [ConstructorCallWith=ExecutionContext] has_extended_attribute_value(interface, 'ConstructorCallWith', 'ExecutionContext'), 'is_constructor': True, 'is_named_constructor': False, 'is_raises_exception': is_constructor_raises_exception, 'number_of_required_arguments': number_of_required_arguments(constructor), }
def generate_constructor(interface, constructor): arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument) for argument in constructor.arguments) return { "argument_list": constructor_argument_list(interface, constructor), "arguments": [ v8_methods.generate_argument(interface, constructor, argument, index, arguments_need_try_catch) for index, argument in enumerate(constructor.arguments) ], "arguments_need_try_catch": arguments_need_try_catch, "cpp_type": cpp_template_type(cpp_ptr_type("RefPtr", "RawPtr", gc_type(interface)), cpp_name(interface)), "has_exception_state": # [RaisesException=Constructor] interface.extended_attributes.get("RaisesException") == "Constructor" or any( argument for argument in constructor.arguments if argument.idl_type.name == "SerializedScriptValue" or argument.idl_type.is_integer_type ), "is_constructor": True, "is_named_constructor": False, "number_of_required_arguments": number_of_required_arguments(constructor), }
def generate_constructor(interface, constructor): arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument) for argument in constructor.arguments) return { 'argument_list': constructor_argument_list(interface, constructor), 'arguments': [v8_methods.generate_argument(interface, constructor, argument, index) for index, argument in enumerate(constructor.arguments)], 'arguments_need_try_catch': arguments_need_try_catch, 'cpp_type': cpp_template_type( cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), cpp_name(interface)), 'has_exception_state': # [RaisesException=Constructor] interface.extended_attributes.get('RaisesException') == 'Constructor' or any(argument for argument in constructor.arguments if argument.idl_type.name == 'SerializedScriptValue' or argument.idl_type.is_integer_type), 'is_constructor': True, 'is_named_constructor': False, 'number_of_required_arguments': number_of_required_arguments(constructor), }