| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 'is_read_only': attribute.is_read_only, | 103 'is_read_only': attribute.is_read_only, |
| 104 'is_reflect': is_reflect, | 104 'is_reflect': is_reflect, |
| 105 'is_replaceable': 'Replaceable' in attribute.extended_attributes, | 105 'is_replaceable': 'Replaceable' in attribute.extended_attributes, |
| 106 'is_setter_raises_exception': ( | 106 'is_setter_raises_exception': ( |
| 107 'RaisesException' in extended_attributes and | 107 'RaisesException' in extended_attributes and |
| 108 extended_attributes['RaisesException'] in [None, 'Setter']), | 108 extended_attributes['RaisesException'] in [None, 'Setter']), |
| 109 'is_static': attribute.is_static, | 109 'is_static': attribute.is_static, |
| 110 'is_unforgeable': 'Unforgeable' in extended_attributes, | 110 'is_unforgeable': 'Unforgeable' in extended_attributes, |
| 111 'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs] | 111 'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs] |
| 112 'name': attribute.name, | 112 'name': attribute.name, |
| 113 'per_context_enabled_function_name': v8_utilities.per_context_enabled_fu
nction_name(attribute), # [PerContextEnabled] | 113 'per_context_enabled_function': v8_utilities.per_context_enabled_functio
n_name(attribute), # [PerContextEnabled] |
| 114 'property_attributes': property_attributes(attribute), | 114 'property_attributes': property_attributes(attribute), |
| 115 'setter_callback': setter_callback_name(interface, attribute), | 115 'setter_callback': setter_callback_name(interface, attribute), |
| 116 'v8_type': v8_types.v8_type(idl_type), | 116 'v8_type': v8_types.v8_type(idl_type), |
| 117 'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_n
ame(attribute), # [RuntimeEnabled] | 117 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a
ttribute), # [RuntimeEnabled] |
| 118 'world_suffixes': ['', 'ForMainWorld'] | 118 'world_suffixes': ['', 'ForMainWorld'] |
| 119 if 'PerWorldBindings' in extended_attributes | 119 if 'PerWorldBindings' in extended_attributes |
| 120 else [''], # [PerWorldBindings] | 120 else [''], # [PerWorldBindings] |
| 121 } | 121 } |
| 122 | 122 |
| 123 if is_constructor_attribute(attribute): | 123 if is_constructor_attribute(attribute): |
| 124 return contents | 124 return contents |
| 125 if not has_custom_getter: | 125 if not has_custom_getter: |
| 126 generate_getter(interface, attribute, contents) | 126 generate_getter(interface, attribute, contents) |
| 127 if not(attribute.is_read_only or has_custom_setter): | 127 if not(attribute.is_read_only or has_custom_setter): |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if ('NotEnumerable' in extended_attributes or | 323 if ('NotEnumerable' in extended_attributes or |
| 324 is_constructor_attribute(attribute)): | 324 is_constructor_attribute(attribute)): |
| 325 property_attributes_list.append('v8::DontEnum') | 325 property_attributes_list.append('v8::DontEnum') |
| 326 if 'Unforgeable' in extended_attributes: | 326 if 'Unforgeable' in extended_attributes: |
| 327 property_attributes_list.append('v8::DontDelete') | 327 property_attributes_list.append('v8::DontDelete') |
| 328 return property_attributes_list or ['v8::None'] | 328 return property_attributes_list or ['v8::None'] |
| 329 | 329 |
| 330 | 330 |
| 331 def is_constructor_attribute(attribute): | 331 def is_constructor_attribute(attribute): |
| 332 return attribute.idl_type.endswith('Constructor') | 332 return attribute.idl_type.endswith('Constructor') |
| OLD | NEW |