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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 if native_array_element_type: | 490 if native_array_element_type: |
491 return v8_value_to_cpp_value_array_or_sequence(native_array_element_type
, v8_value, index) | 491 return v8_value_to_cpp_value_array_or_sequence(native_array_element_type
, v8_value, index) |
492 | 492 |
493 # Simple types | 493 # Simple types |
494 idl_type = idl_type.preprocessed_type | 494 idl_type = idl_type.preprocessed_type |
495 add_includes_for_type(idl_type) | 495 add_includes_for_type(idl_type) |
496 base_idl_type = idl_type.base_type | 496 base_idl_type = idl_type.base_type |
497 | 497 |
498 if 'EnforceRange' in extended_attributes: | 498 if 'EnforceRange' in extended_attributes: |
499 arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState']) | 499 arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState']) |
| 500 elif 'Clamp' in extended_attributes: |
| 501 arguments = ', '.join([v8_value, 'Clamp', 'exceptionState']) |
500 elif idl_type.v8_conversion_needs_exception_state: | 502 elif idl_type.v8_conversion_needs_exception_state: |
501 arguments = ', '.join([v8_value, 'exceptionState']) | 503 arguments = ', '.join([v8_value, 'exceptionState']) |
502 else: | 504 else: |
503 arguments = v8_value | 505 arguments = v8_value |
504 | 506 |
505 if base_idl_type in V8_VALUE_TO_CPP_VALUE: | 507 if base_idl_type in V8_VALUE_TO_CPP_VALUE: |
506 cpp_expression_format = V8_VALUE_TO_CPP_VALUE[base_idl_type] | 508 cpp_expression_format = V8_VALUE_TO_CPP_VALUE[base_idl_type] |
507 elif idl_type.is_typed_array_element_type: | 509 elif idl_type.is_typed_array_element_type: |
508 cpp_expression_format = ( | 510 cpp_expression_format = ( |
509 '{v8_value}->Is{idl_type}() ? ' | 511 '{v8_value}->Is{idl_type}() ? ' |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 | 823 |
822 | 824 |
823 def is_explicit_nullable(idl_type): | 825 def is_explicit_nullable(idl_type): |
824 # Nullable type that isn't implicit nullable (see above.) For such types, | 826 # Nullable type that isn't implicit nullable (see above.) For such types, |
825 # we use Nullable<T> or similar explicit ways to represent a null value. | 827 # we use Nullable<T> or similar explicit ways to represent a null value. |
826 return idl_type.is_nullable and not idl_type.is_implicit_nullable | 828 return idl_type.is_nullable and not idl_type.is_implicit_nullable |
827 | 829 |
828 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) | 830 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) |
829 IdlUnionType.is_implicit_nullable = False | 831 IdlUnionType.is_implicit_nullable = False |
830 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) | 832 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) |
OLD | NEW |