OLD | NEW |
1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} | 1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% macro generate_method(method, world_suffix) %} | 5 {% macro generate_method(method, world_suffix) %} |
6 {% filter conditional(method.conditional_string) %} | 6 {% filter conditional(method.conditional_string) %} |
7 {% if method.returns_promise and method.has_exception_state %} | 7 {% if method.returns_promise and method.has_exception_state %} |
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) | 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) |
9 {% else %} | 9 {% else %} |
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 {%- elif v8_set_return_value %} | 263 {%- elif v8_set_return_value %} |
264 {% if method.is_explicit_nullable %} | 264 {% if method.is_explicit_nullable %} |
265 if (result.isNull()) | 265 if (result.isNull()) |
266 v8SetReturnValueNull(info); | 266 v8SetReturnValueNull(info); |
267 else | 267 else |
268 {{v8_set_return_value}}; | 268 {{v8_set_return_value}}; |
269 {% else %} | 269 {% else %} |
270 {{v8_set_return_value}}; | 270 {{v8_set_return_value}}; |
271 {% endif %} | 271 {% endif %} |
272 {%- endif %}{# None for void #} | 272 {%- endif %}{# None for void #} |
273 {# Post-set #} | 273 {% if method.is_custom_call_epilogue %} |
274 {% if interface_name in ('EventTarget', 'MediaQueryList') | 274 {{v8_class}}::{{method.name}}MethodEpilogueCustom(info, impl); |
275 and method.name in ('addEventListener', 'removeEventListener', 'addListener'
, 'removeListener') %} | |
276 {% set hidden_dependency_action = 'addHiddenValueToArray' | |
277 if method.name in ('addEventListener', 'addListener') else 'removeHiddenV
alueFromArray' %} | |
278 {% set argument_index = '1' if interface_name == 'EventTarget' else '0' %} | |
279 {# Length check needed to skip action on legacy calls without enough arguments. | |
280 http://crbug.com/353484 #} | |
281 if (info.Length() >= {{argument_index}} + 1 && listener && !impl->toNode()) | |
282 {{hidden_dependency_action}}(info.GetIsolate(), info.Holder(), info[{{argume
nt_index}}], {{v8_class}}::eventListenerCacheIndex); | |
283 {% endif %} | 275 {% endif %} |
284 {% endmacro %} | 276 {% endmacro %} |
285 | 277 |
286 | 278 |
287 {######################################} | 279 {######################################} |
288 {% macro throw_type_error(method, error_message) %} | 280 {% macro throw_type_error(method, error_message) %} |
289 {% if method.has_exception_state %} | 281 {% if method.has_exception_state %} |
290 exceptionState.throwTypeError({{error_message}}); | 282 exceptionState.throwTypeError({{error_message}}); |
291 {{propagate_error_with_exception_state(method)}} | 283 {{propagate_error_with_exception_state(method)}} |
292 {% elif method.idl_type == 'Promise' %} | 284 {% elif method.idl_type == 'Promise' %} |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 if method.overloads else | 653 if method.overloads else |
662 method.runtime_enabled_function) %} | 654 method.runtime_enabled_function) %} |
663 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio
nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho
dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument
s}})->GetFunction()); | 655 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio
nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho
dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument
s}})->GetFunction()); |
664 {% endfilter %}{# runtime_enabled() #} | 656 {% endfilter %}{# runtime_enabled() #} |
665 {% endfilter %}{# exposed() #} | 657 {% endfilter %}{# exposed() #} |
666 {% endfilter %}{# per_context_enabled() #} | 658 {% endfilter %}{# per_context_enabled() #} |
667 {% endfor %} | 659 {% endfor %} |
668 {% endif %} | 660 {% endif %} |
669 } | 661 } |
670 {%- endmacro %} | 662 {%- endmacro %} |
OLD | NEW |