| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 return { | 364 return { |
| 365 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)'
% (vector_type, this_cpp_type, index), | 365 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)'
% (vector_type, this_cpp_type, index), |
| 366 'check_expression': 'exceptionState.hadException()', | 366 'check_expression': 'exceptionState.hadException()', |
| 367 'cpp_type': this_cpp_type, | 367 'cpp_type': this_cpp_type, |
| 368 'cpp_name': argument.name, | 368 'cpp_name': argument.name, |
| 369 'declare_variable': False, | 369 'declare_variable': False, |
| 370 } | 370 } |
| 371 | 371 |
| 372 | 372 |
| 373 def v8_value_to_local_cpp_value(method, argument, index, return_promise=False, r
estricted_float=False): | 373 def v8_value_to_local_cpp_value(method, argument, index, return_promise=False): |
| 374 extended_attributes = argument.extended_attributes | 374 extended_attributes = argument.extended_attributes |
| 375 idl_type = argument.idl_type | 375 idl_type = argument.idl_type |
| 376 name = argument.name | 376 name = argument.name |
| 377 if argument.is_variadic: | 377 if argument.is_variadic: |
| 378 return v8_value_to_local_cpp_variadic_value(method, argument, index, ret
urn_promise) | 378 return v8_value_to_local_cpp_variadic_value(method, argument, index, ret
urn_promise) |
| 379 return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]'
% index, | 379 return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]'
% index, |
| 380 name, index=index, declare_varia
ble=False, | 380 name, index=index, declare_varia
ble=False, |
| 381 use_exception_state=method.retur
ns_promise, | 381 use_exception_state=method.retur
ns_promise) |
| 382 restricted_float=restricted_floa
t) | |
| 383 | 382 |
| 384 | 383 |
| 385 ################################################################################ | 384 ################################################################################ |
| 386 # Auxiliary functions | 385 # Auxiliary functions |
| 387 ################################################################################ | 386 ################################################################################ |
| 388 | 387 |
| 389 # [NotEnumerable], [Unforgeable] | 388 # [NotEnumerable], [Unforgeable] |
| 390 def property_attributes(interface, method): | 389 def property_attributes(interface, method): |
| 391 extended_attributes = method.extended_attributes | 390 extended_attributes = method.extended_attributes |
| 392 property_attributes_list = [] | 391 property_attributes_list = [] |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 return method.idl_type and method.idl_type.name == 'Promise' | 446 return method.idl_type and method.idl_type.name == 'Promise' |
| 448 | 447 |
| 449 IdlOperation.returns_promise = property(method_returns_promise) | 448 IdlOperation.returns_promise = property(method_returns_promise) |
| 450 | 449 |
| 451 | 450 |
| 452 def argument_conversion_needs_exception_state(method, argument): | 451 def argument_conversion_needs_exception_state(method, argument): |
| 453 idl_type = argument.idl_type | 452 idl_type = argument.idl_type |
| 454 return (idl_type.v8_conversion_needs_exception_state or | 453 return (idl_type.v8_conversion_needs_exception_state or |
| 455 argument.is_variadic or | 454 argument.is_variadic or |
| 456 (method.returns_promise and idl_type.is_string_type)) | 455 (method.returns_promise and idl_type.is_string_type)) |
| OLD | NEW |