| OLD | NEW |
| 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} |
| 2 | 2 |
| 3 {##############################################################################} | 3 {##############################################################################} |
| 4 {% macro generate_method(method, world_suffix) %} | 4 {% macro generate_method(method, world_suffix) %} |
| 5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) { | 5 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) { |
| 6 {% filter format_remove_duplicates([ | 6 {% filter format_remove_duplicates([ |
| 7 'ExceptionState exceptionState', | 7 'ExceptionState exceptionState', |
| 8 'ScriptState* scriptState = ']) %} | 8 'ScriptState* scriptState = ']) %} |
| 9 {% set define_exception_state -%} | 9 {% set define_exception_state -%} |
| 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "{{interface_name}}", "{{method.name}}"); | 10 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "{{interface_name}}", "{{method.name}}"); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 {{throw_argument_error(method, argument, "The callback provided as parameter %
(index)d is not a function.")}} | 181 {{throw_argument_error(method, argument, "The callback provided as parameter %
(index)d is not a function.")}} |
| 182 return; | 182 return; |
| 183 } | 183 } |
| 184 {{v8_value_to_local_cpp_value(argument)}} | 184 {{v8_value_to_local_cpp_value(argument)}} |
| 185 {% elif argument.is_variadic_wrapper_type %} | 185 {% elif argument.is_variadic_wrapper_type %} |
| 186 for (int i = {{argument.index}}; i < info.Length(); ++i) { | 186 for (int i = {{argument.index}}; i < info.Length(); ++i) { |
| 187 if (!V8{{argument.idl_type}}::hasInstance(info[i], info.GetIsolate())) { | 187 if (!V8{{argument.idl_type}}::hasInstance(info[i], info.GetIsolate())) { |
| 188 {{throw_argument_error(method, argument, "parameter %(index)d is not of type
'%(type)s'.")}} | 188 {{throw_argument_error(method, argument, "parameter %(index)d is not of type
'%(type)s'.")}} |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 {{argument.name}}.append(V8{{argument.idl_type}}::toImpl(v8::Local<v8::Object>
::Cast(info[i]))); | 191 {{argument.name}}.push_back(V8{{argument.idl_type}}::toImpl(v8::Local<v8::Obje
ct>::Cast(info[i]))); |
| 192 } | 192 } |
| 193 {% elif argument.is_dictionary %} | 193 {% elif argument.is_dictionary %} |
| 194 {% if not argument.use_permissive_dictionary_conversion %} | 194 {% if not argument.use_permissive_dictionary_conversion %} |
| 195 {# Dictionaries must have type Undefined, Null or Object: | 195 {# Dictionaries must have type Undefined, Null or Object: |
| 196 http://heycam.github.io/webidl/#es-dictionary #} | 196 http://heycam.github.io/webidl/#es-dictionary #} |
| 197 if (!isUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->I
sObject()) { | 197 if (!isUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->I
sObject()) { |
| 198 {{throw_argument_error(method, argument, "parameter %(index)d ('%(name)s') is
not an object.")}} | 198 {{throw_argument_error(method, argument, "parameter %(index)d ('%(name)s') is
not an object.")}} |
| 199 return; | 199 return; |
| 200 } | 200 } |
| 201 {% endif %}{# not argument.use_permissive_dictionary_conversion #} | 201 {% endif %}{# not argument.use_permissive_dictionary_conversion #} |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 if method.overloads else | 637 if method.overloads else |
| 638 method.runtime_enabled_feature_name) %} | 638 method.runtime_enabled_feature_name) %} |
| 639 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 639 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
| 640 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); | 640 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); |
| 641 {% endfilter %}{# runtime_enabled() #} | 641 {% endfilter %}{# runtime_enabled() #} |
| 642 {% endfilter %}{# exposed() #} | 642 {% endfilter %}{# exposed() #} |
| 643 {% endfilter %}{# secure_context() #} | 643 {% endfilter %}{# secure_context() #} |
| 644 {% endfor %} | 644 {% endfor %} |
| 645 {% endif %} | 645 {% endif %} |
| 646 {%- endmacro %} | 646 {%- endmacro %} |
| OLD | NEW |