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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 370 } |
371 | 371 |
372 | 372 |
373 def v8_value_to_local_cpp_value(method, argument, index, return_promise=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, declare_variable=False, |
381 use_exception_state=method.retur
ns_promise) | 381 use_exception_state=method.retur
ns_promise) |
382 | 382 |
383 | 383 |
384 ################################################################################ | 384 ################################################################################ |
385 # Auxiliary functions | 385 # Auxiliary functions |
386 ################################################################################ | 386 ################################################################################ |
387 | 387 |
388 # [NotEnumerable], [Unforgeable] | 388 # [NotEnumerable], [Unforgeable] |
389 def property_attributes(interface, method): | 389 def property_attributes(interface, method): |
390 extended_attributes = method.extended_attributes | 390 extended_attributes = method.extended_attributes |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 return method.idl_type and method.idl_type.name == 'Promise' | 446 return method.idl_type and method.idl_type.name == 'Promise' |
447 | 447 |
448 IdlOperation.returns_promise = property(method_returns_promise) | 448 IdlOperation.returns_promise = property(method_returns_promise) |
449 | 449 |
450 | 450 |
451 def argument_conversion_needs_exception_state(method, argument): | 451 def argument_conversion_needs_exception_state(method, argument): |
452 idl_type = argument.idl_type | 452 idl_type = argument.idl_type |
453 return (idl_type.v8_conversion_needs_exception_state or | 453 return (idl_type.v8_conversion_needs_exception_state or |
454 argument.is_variadic or | 454 argument.is_variadic or |
455 (method.returns_promise and idl_type.is_string_type)) | 455 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |