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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 'is_custom_element_callbacks': is_custom_element_callbacks, | 149 'is_custom_element_callbacks': is_custom_element_callbacks, |
150 # TODO(yukishiino): Make all DOM attributes accessor-type properties. | 150 # TODO(yukishiino): Make all DOM attributes accessor-type properties. |
151 'is_data_type_property': is_data_type_property(interface, attribute), | 151 'is_data_type_property': is_data_type_property(interface, attribute), |
152 'is_getter_raises_exception': # [RaisesException] | 152 'is_getter_raises_exception': # [RaisesException] |
153 'RaisesException' in extended_attributes and | 153 'RaisesException' in extended_attributes and |
154 extended_attributes['RaisesException'] in (None, 'Getter'), | 154 extended_attributes['RaisesException'] in (None, 'Getter'), |
155 'is_keep_alive_for_gc': keep_alive_for_gc, | 155 'is_keep_alive_for_gc': keep_alive_for_gc, |
156 'is_lenient_this': 'LenientThis' in extended_attributes, | 156 'is_lenient_this': 'LenientThis' in extended_attributes, |
157 'is_nullable': idl_type.is_nullable, | 157 'is_nullable': idl_type.is_nullable, |
158 'is_explicit_nullable': idl_type.is_explicit_nullable, | 158 'is_explicit_nullable': idl_type.is_explicit_nullable, |
| 159 'is_named_constructor': is_named_constructor_attribute(attribute), |
159 'is_partial_interface_member': | 160 'is_partial_interface_member': |
160 'PartialInterfaceImplementedAs' in extended_attributes, | 161 'PartialInterfaceImplementedAs' in extended_attributes, |
161 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, | 162 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, |
162 'is_put_forwards': 'PutForwards' in extended_attributes, | 163 'is_put_forwards': 'PutForwards' in extended_attributes, |
163 'is_read_only': attribute.is_read_only, | 164 'is_read_only': attribute.is_read_only, |
164 'is_reflect': is_reflect, | 165 'is_reflect': is_reflect, |
165 'is_replaceable': 'Replaceable' in attribute.extended_attributes, | 166 'is_replaceable': 'Replaceable' in attribute.extended_attributes, |
166 'is_save_same_object': is_save_same_object, | 167 'is_save_same_object': is_save_same_object, |
167 'is_static': attribute.is_static, | 168 'is_static': attribute.is_static, |
168 'is_url': 'URL' in extended_attributes, | 169 'is_url': 'URL' in extended_attributes, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 return (not attribute.is_read_only and | 556 return (not attribute.is_read_only and |
556 'Custom' in extended_attributes and | 557 'Custom' in extended_attributes and |
557 extended_attributes['Custom'] in [None, 'Setter']) | 558 extended_attributes['Custom'] in [None, 'Setter']) |
558 | 559 |
559 | 560 |
560 ################################################################################ | 561 ################################################################################ |
561 # Constructors | 562 # Constructors |
562 ################################################################################ | 563 ################################################################################ |
563 | 564 |
564 idl_types.IdlType.constructor_type_name = property( | 565 idl_types.IdlType.constructor_type_name = property( |
565 # FIXME: replace this with a [ConstructorAttribute] extended attribute | |
566 lambda self: strip_suffix(self.base_type, 'Constructor')) | 566 lambda self: strip_suffix(self.base_type, 'Constructor')) |
567 | 567 |
568 | 568 |
569 def is_constructor_attribute(attribute): | 569 def is_constructor_attribute(attribute): |
570 # FIXME: replace this with [ConstructorAttribute] extended attribute | |
571 return attribute.idl_type.name.endswith('Constructor') | 570 return attribute.idl_type.name.endswith('Constructor') |
572 | 571 |
573 | 572 |
| 573 def is_named_constructor_attribute(attribute): |
| 574 return attribute.idl_type.name.endswith('ConstructorConstructor') |
| 575 |
| 576 |
574 def update_constructor_attribute_context(interface, attribute, context): | 577 def update_constructor_attribute_context(interface, attribute, context): |
575 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 578 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
OLD | NEW |