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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]'
% index, | 398 return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]'
% index, |
399 name, index=index, declare_varia
ble=False, | 399 name, index=index, declare_varia
ble=False, |
400 use_exception_state=method.retur
ns_promise, | 400 use_exception_state=method.retur
ns_promise, |
401 restricted_float=restricted_floa
t) | 401 restricted_float=restricted_floa
t) |
402 | 402 |
403 | 403 |
404 ################################################################################ | 404 ################################################################################ |
405 # Auxiliary functions | 405 # Auxiliary functions |
406 ################################################################################ | 406 ################################################################################ |
407 | 407 |
408 # [NotEnumerable] | 408 # [NotEnumerable], [Unforgeable] |
409 def property_attributes(interface, method): | 409 def property_attributes(interface, method): |
410 extended_attributes = method.extended_attributes | 410 extended_attributes = method.extended_attributes |
411 property_attributes_list = [] | 411 property_attributes_list = [] |
412 if 'NotEnumerable' in extended_attributes: | 412 if 'NotEnumerable' in extended_attributes: |
413 property_attributes_list.append('v8::DontEnum') | 413 property_attributes_list.append('v8::DontEnum') |
414 if is_unforgeable(interface, method): | 414 if is_unforgeable(interface, method): |
415 property_attributes_list.append('v8::ReadOnly') | 415 property_attributes_list.append('v8::ReadOnly') |
416 if property_attributes_list: | 416 property_attributes_list.append('v8::DontDelete') |
417 property_attributes_list.insert(0, 'v8::DontDelete') | |
418 return property_attributes_list | 417 return property_attributes_list |
419 | 418 |
420 | 419 |
421 def argument_set_default_value(argument): | 420 def argument_set_default_value(argument): |
422 idl_type = argument.idl_type | 421 idl_type = argument.idl_type |
423 default_value = argument.default_value | 422 default_value = argument.default_value |
424 if not default_value: | 423 if not default_value: |
425 return None | 424 return None |
426 if idl_type.is_dictionary: | 425 if idl_type.is_dictionary: |
427 if not argument.default_value.is_null: | 426 if not argument.default_value.is_null: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 return method.idl_type and method.idl_type.name == 'Promise' | 466 return method.idl_type and method.idl_type.name == 'Promise' |
468 | 467 |
469 IdlOperation.returns_promise = property(method_returns_promise) | 468 IdlOperation.returns_promise = property(method_returns_promise) |
470 | 469 |
471 | 470 |
472 def argument_conversion_needs_exception_state(method, argument): | 471 def argument_conversion_needs_exception_state(method, argument): |
473 idl_type = argument.idl_type | 472 idl_type = argument.idl_type |
474 return (idl_type.v8_conversion_needs_exception_state or | 473 return (idl_type.v8_conversion_needs_exception_state or |
475 argument.is_variadic or | 474 argument.is_variadic or |
476 (method.returns_promise and idl_type.is_string_type)) | 475 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |