OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {# FIXME: We should return a rejected Promise if an error occurs in this | 2 {# FIXME: We should return a rejected Promise if an error occurs in this |
3 function when ALL methods in this overload return Promise. In order to do so, | 3 function when ALL methods in this overload return Promise. In order to do so, |
4 we must ensure either ALL or NO methods in this overload return Promise #} | 4 we must ensure either ALL or NO methods in this overload return Promise #} |
5 {% macro overload_resolution_method(method) %} | 5 {% macro overload_resolution_method(method) %} |
6 {% set overloads = method.overloads %} | 6 {% set overloads = method.overloads %} |
7 {% if method.is_static %} | 7 {% if method.is_static %} |
8 {% set offset = 0 %} | 8 {% set offset = 0 %} |
9 {% else %} | 9 {% else %} |
10 {% set offset = 1 %} | 10 {% set offset = 1 %} |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 exception = ToDart("Failed to fetch domWindow"); | 328 exception = ToDart("Failed to fetch domWindow"); |
329 goto fail; | 329 goto fail; |
330 } | 330 } |
331 Document& document = *domWindow->document(); | 331 Document& document = *domWindow->document(); |
332 {% endif %} | 332 {% endif %} |
333 int argCount /* FIXME(vsm): Remove this. */ ALLOW_UNUSED = Dart_GetNativ
eArgumentCount(args); | 333 int argCount /* FIXME(vsm): Remove this. */ ALLOW_UNUSED = Dart_GetNativ
eArgumentCount(args); |
334 {% if constructor.has_exception_state %} | 334 {% if constructor.has_exception_state %} |
335 ExceptionState es; | 335 ExceptionState es; |
336 {% endif %} | 336 {% endif %} |
337 {{generate_arguments(constructor) | indent(8)}} | 337 {{generate_arguments(constructor) | indent(8)}} |
| 338 {# TODO(iansf): The following line is incorrect if the constructor throw
s an exception. In that case, we should not call AssociateWithDartWrapper, as t
he constructor may have returned a nullptr. #} |
338 {{constructor.cpp_value}}->AssociateWithDartWrapper(args); | 339 {{constructor.cpp_value}}->AssociateWithDartWrapper(args); |
339 {% if constructor.has_exception_state %} | 340 {% if constructor.has_exception_state %} |
340 if (es.had_exception()) { | 341 if (es.had_exception()) { |
| 342 {# TODO(iansf): The following line does not work in the case that an
exception was thrown. Investigate why. #} |
341 exception = es.GetDartException(args, {{constructor.auto_scope}}); | 343 exception = es.GetDartException(args, {{constructor.auto_scope}}); |
342 goto fail; | 344 goto fail; |
343 } | 345 } |
344 | 346 |
345 {% endif %} | 347 {% endif %} |
346 return; | 348 return; |
347 } | 349 } |
348 | 350 |
349 {% if arguments_count > 0 or constructor.has_exception_state or is_constructor_c
all_with_execution_context or is_constructor_call_with_document or (constructor
== named_constructor) %} | 351 {% if arguments_count > 0 or constructor.has_exception_state or is_constructor_c
all_with_execution_context or is_constructor_call_with_document or (constructor
== named_constructor) %} |
350 fail: | 352 fail: |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 401 |
400 {##############################################################################} | 402 {##############################################################################} |
401 {% macro generate_symbolizer_constructor(dart_class, class_name, constructor) %} | 403 {% macro generate_symbolizer_constructor(dart_class, class_name, constructor) %} |
402 {% for native_entry in constructor.native_entries %} | 404 {% for native_entry in constructor.native_entries %} |
403 {% set resolver_string = native_entry.resolver_string %} | 405 {% set resolver_string = native_entry.resolver_string %} |
404 if (native_function == {{dart_class}}Internal::{{static_method_name(constructor.
name, constructor.overload_index)}}) { | 406 if (native_function == {{dart_class}}Internal::{{static_method_name(constructor.
name, constructor.overload_index)}}) { |
405 return reinterpret_cast<const uint8_t*>("{{resolver_string}}"); | 407 return reinterpret_cast<const uint8_t*>("{{resolver_string}}"); |
406 } | 408 } |
407 {% endfor %} | 409 {% endfor %} |
408 {% endmacro %} | 410 {% endmacro %} |
OLD | NEW |