コード例 #1
0
def generate_constructor(interface, constructor):
    return {
        'argument_list':
        constructor_argument_list(interface, constructor),
        'arguments': [
            v8_methods.generate_argument(interface, constructor, argument,
                                         index)
            for index, argument in enumerate(constructor.arguments)
        ],
        '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),
    }
コード例 #2
0
def generate_constructor(interface, constructor):
    return {
        'argument_list': constructor_argument_list(interface, constructor),
        'arguments': [v8_methods.generate_argument(interface, constructor, argument, index)
                      for index, argument in enumerate(constructor.arguments)],
        '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,
        'is_variadic': False,  # Required for overload resolution
        'number_of_required_arguments':
            number_of_required_arguments(constructor),
    }
コード例 #3
0
ファイル: v8_interface.py プロジェクト: zanxi/bitpop
def generate_constructor(interface, constructor):
    return {
        "argument_list": constructor_argument_list(interface, constructor),
        "arguments": [
            v8_methods.generate_argument(interface, constructor, argument, index)
            for index, argument in enumerate(constructor.arguments)
        ],
        "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,
        "is_variadic": False,  # Required for overload resolution
        "number_of_required_arguments": number_of_required_arguments(constructor),
    }
コード例 #4
0
ファイル: v8_interface.py プロジェクト: venkatarajasekhar/Qt
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),
    }