| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial) | 512 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial) |
| 513 | 513 |
| 514 | 514 |
| 515 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name
, needs_type_check, index, isolate): | 515 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name
, needs_type_check, index, isolate): |
| 516 if idl_type.name == 'void': | 516 if idl_type.name == 'void': |
| 517 return '' | 517 return '' |
| 518 | 518 |
| 519 # Array or sequence types | 519 # Array or sequence types |
| 520 native_array_element_type = idl_type.native_array_element_type | 520 native_array_element_type = idl_type.native_array_element_type |
| 521 if native_array_element_type: | 521 if native_array_element_type: |
| 522 return v8_value_to_cpp_value_array_or_sequence(native_array_element_type
, v8_value, index) | 522 return v8_value_to_cpp_value_array_or_sequence(native_array_element_type
, v8_value, index, isolate) |
| 523 | 523 |
| 524 # Simple types | 524 # Simple types |
| 525 idl_type = idl_type.preprocessed_type | 525 idl_type = idl_type.preprocessed_type |
| 526 add_includes_for_type(idl_type) | 526 add_includes_for_type(idl_type) |
| 527 base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else i
dl_type.base_type | 527 base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else i
dl_type.base_type |
| 528 | 528 |
| 529 if 'EnforceRange' in extended_attributes: | 529 if 'EnforceRange' in extended_attributes: |
| 530 arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState']) | 530 arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState']) |
| 531 elif 'Clamp' in extended_attributes: | 531 elif 'Clamp' in extended_attributes: |
| 532 arguments = ', '.join([v8_value, 'Clamp', 'exceptionState']) | 532 arguments = ', '.join([v8_value, 'Clamp', 'exceptionState']) |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 number_of_nullable_member_types_union) | 914 number_of_nullable_member_types_union) |
| 915 | 915 |
| 916 | 916 |
| 917 def includes_nullable_type_union(idl_type): | 917 def includes_nullable_type_union(idl_type): |
| 918 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 918 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
| 919 return idl_type.number_of_nullable_member_types == 1 | 919 return idl_type.number_of_nullable_member_types == 1 |
| 920 | 920 |
| 921 IdlTypeBase.includes_nullable_type = False | 921 IdlTypeBase.includes_nullable_type = False |
| 922 IdlNullableType.includes_nullable_type = True | 922 IdlNullableType.includes_nullable_type = True |
| 923 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 923 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
| OLD | NEW |