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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 idl_type.is_dictionary or | 478 idl_type.is_dictionary or |
479 idl_type.name in ('ByteString', 'ScalarValueString')) | 479 idl_type.name in ('ByteString', 'ScalarValueString')) |
480 | 480 |
481 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep
tion_state) | 481 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep
tion_state) |
482 | 482 |
483 | 483 |
484 def v8_conversion_is_trivial(idl_type): | 484 def v8_conversion_is_trivial(idl_type): |
485 # The conversion is a simple expression that returns the converted value and | 485 # The conversion is a simple expression that returns the converted value and |
486 # cannot raise an exception. | 486 # cannot raise an exception. |
487 return (idl_type.base_type == 'boolean' or | 487 return (idl_type.base_type == 'boolean' or |
| 488 idl_type.base_type == 'Dictionary' or |
488 idl_type.is_wrapper_type) | 489 idl_type.is_wrapper_type) |
489 | 490 |
490 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial) | 491 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial) |
491 | 492 |
492 | 493 |
493 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
e): | 494 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
e): |
494 if idl_type.name == 'void': | 495 if idl_type.name == 'void': |
495 return '' | 496 return '' |
496 | 497 |
497 # Array or sequence types | 498 # Array or sequence types |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 838 |
838 | 839 |
839 def is_explicit_nullable(idl_type): | 840 def is_explicit_nullable(idl_type): |
840 # Nullable type that isn't implicit nullable (see above.) For such types, | 841 # Nullable type that isn't implicit nullable (see above.) For such types, |
841 # we use Nullable<T> or similar explicit ways to represent a null value. | 842 # we use Nullable<T> or similar explicit ways to represent a null value. |
842 return idl_type.is_nullable and not idl_type.is_implicit_nullable | 843 return idl_type.is_nullable and not idl_type.is_implicit_nullable |
843 | 844 |
844 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) | 845 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) |
845 IdlUnionType.is_implicit_nullable = False | 846 IdlUnionType.is_implicit_nullable = False |
846 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) | 847 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) |
OLD | NEW |