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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 {% elif argument.is_array_or_sequence_type %} | 240 {% elif argument.is_array_or_sequence_type %} |
241 {{argument.local_cpp_type}} {{argument.name}}; | 241 {{argument.local_cpp_type}} {{argument.name}}; |
242 {{argument.dart_value_to_local_cpp_value}}; | 242 {{argument.dart_value_to_local_cpp_value}}; |
243 {% else %} | 243 {% else %} |
244 {% if argument.is_dictionary and argument.dart_value_dictionary_cpp_value %} | 244 {% if argument.is_dictionary and argument.dart_value_dictionary_cpp_value %} |
245 Dictionary dictionary = {{argument.dart_value_dictionary_cpp_value}}; | 245 Dictionary dictionary = {{argument.dart_value_dictionary_cpp_value}}; |
246 if (exception) | 246 if (exception) |
247 goto fail; | 247 goto fail; |
248 {% endif %} | 248 {% endif %} |
249 {{argument.local_cpp_type}} {{argument.name}} = {{argument.dart_value_to_local_c
pp_value}}; | 249 {{argument.local_cpp_type}} {{argument.name}} = {{argument.dart_value_to_local_c
pp_value}}; |
| 250 {% if argument.enum_validation_expression %} |
| 251 if (!({{argument.enum_validation_expression}})) { |
| 252 exception = Dart_NewStringFromCString("param {{argument.arg_index}} not valid"
); |
| 253 } |
| 254 {% endif %} |
250 {% endif %} | 255 {% endif %} |
251 {% endif %}{# argument.is_callback_interface #} | 256 {% endif %}{# argument.is_callback_interface #} |
252 if (exception) | 257 if (exception) |
253 goto fail; | 258 goto fail; |
254 {% if argument.is_dictionary and argument.is_optional and argument.dart_value_di
ctionary_cpp_value %} | 259 {% if argument.is_dictionary and argument.is_optional and argument.dart_value_di
ctionary_cpp_value %} |
255 if (es.hadException()) { | 260 if (es.hadException()) { |
256 exception = es.toDart(args, true); | 261 exception = es.toDart(args, true); |
257 goto fail; | 262 goto fail; |
258 } | 263 } |
259 {% endif %} | 264 {% endif %} |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 524 |
520 {##############################################################################} | 525 {##############################################################################} |
521 {% macro generate_symbolizer_constructor(dart_class, class_name, constructor) %} | 526 {% macro generate_symbolizer_constructor(dart_class, class_name, constructor) %} |
522 {% for native_entry in constructor.native_entries %} | 527 {% for native_entry in constructor.native_entries %} |
523 {% set resolver_string = native_entry.resolver_string %} | 528 {% set resolver_string = native_entry.resolver_string %} |
524 if (nf == {{dart_class}}Internal::{{static_method_name(constructor.name, constru
ctor.overload_index)}}) { | 529 if (nf == {{dart_class}}Internal::{{static_method_name(constructor.name, constru
ctor.overload_index)}}) { |
525 return reinterpret_cast<const uint8_t*>("{{resolver_string}}"); | 530 return reinterpret_cast<const uint8_t*>("{{resolver_string}}"); |
526 } | 531 } |
527 {% endfor %} | 532 {% endfor %} |
528 {% endmacro %} | 533 {% endmacro %} |
OLD | NEW |