OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
5 { | 5 { |
6 {# Local variables #} | 6 {# Local variables #} |
7 {% if method.has_exception_state %} | 7 {% if method.has_exception_state %} |
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
9 {% endif %} | 9 {% endif %} |
10 {# Overloaded methods have length checked during overload resolution #} | 10 {# Overloaded methods have length checked during overload resolution #} |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 {% for argument in method.arguments %} | 63 {% for argument in method.arguments %} |
64 {{generate_argument_var_declaration(argument)}}; | 64 {{generate_argument_var_declaration(argument)}}; |
65 {% endfor %} | 65 {% endfor %} |
66 { | 66 { |
67 {% if method.arguments_need_try_catch %} | 67 {% if method.arguments_need_try_catch %} |
68 v8::TryCatch block; | 68 v8::TryCatch block; |
69 V8RethrowTryCatchScope rethrow(block); | 69 V8RethrowTryCatchScope rethrow(block); |
70 {% endif %} | 70 {% endif %} |
71 {% for argument in method.arguments %} | 71 {% for argument in method.arguments %} |
72 {% if argument.default_value %} | 72 {% if argument.default_value %} |
73 if (info.Length() > {{argument.index}}) { | 73 if (!info[{{argument.index}}]->IsUndefined()) { |
74 {{generate_argument(method, argument, world_suffix) | indent(8)}} | 74 {{generate_argument(method, argument, world_suffix) | indent(8)}} |
75 } else { | 75 } else { |
76 {{argument.name}} = {{argument.default_value}}; | 76 {{argument.name}} = {{argument.default_value}}; |
77 } | 77 } |
78 {% else %} | 78 {% else %} |
79 {{generate_argument(method, argument, world_suffix) | indent}} | 79 {{generate_argument(method, argument, world_suffix) | indent}} |
80 {% endif %} | 80 {% endif %} |
81 {% endfor %} | 81 {% endfor %} |
82 } | 82 } |
83 {% endmacro %} | 83 {% endmacro %} |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), isolate); | 591 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), isolate); |
592 {% else %} | 592 {% else %} |
593 {% set constructor_class = v8_class + ('Constructor' | 593 {% set constructor_class = v8_class + ('Constructor' |
594 if constructor.is_named_constructor else | 594 if constructor.is_named_constructor else |
595 '') %} | 595 '') %} |
596 v8::Handle<v8::Object> wrapper = info.Holder(); | 596 v8::Handle<v8::Object> wrapper = info.Holder(); |
597 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, isolate, {{wrapper_configuration}}); | 597 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, isolate, {{wrapper_configuration}}); |
598 {% endif %} | 598 {% endif %} |
599 v8SetReturnValue(info, wrapper); | 599 v8SetReturnValue(info, wrapper); |
600 {% endmacro %} | 600 {% endmacro %} |
OLD | NEW |