| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if is_constructor_attribute(attribute): | 191 if is_constructor_attribute(attribute): |
| 192 update_constructor_attribute_context(interface, attribute, context) | 192 update_constructor_attribute_context(interface, attribute, context) |
| 193 if not has_custom_getter(attribute): | 193 if not has_custom_getter(attribute): |
| 194 getter_context(interface, attribute, context) | 194 getter_context(interface, attribute, context) |
| 195 if not has_custom_setter(attribute) and has_setter(interface, attribute): | 195 if not has_custom_setter(attribute) and has_setter(interface, attribute): |
| 196 setter_context(interface, attribute, interfaces, context) | 196 setter_context(interface, attribute, interfaces, context) |
| 197 | 197 |
| 198 # [CrossOrigin] is incompatible with a number of other attributes, so check | 198 # [CrossOrigin] is incompatible with a number of other attributes, so check |
| 199 # for them here. | 199 # for them here. |
| 200 if is_cross_origin: | 200 if is_cross_origin: |
| 201 if context['has_cross_origin_getter'] and context['has_custom_getter']: | |
| 202 raise Exception('[CrossOrigin] and [Custom] are incompatible on the
same getter: %s.%s', interface.name, attribute.name) | |
| 203 if context['has_cross_origin_setter'] and context['has_custom_setter']: | 201 if context['has_cross_origin_setter'] and context['has_custom_setter']: |
| 204 raise Exception('[CrossOrigin] and [Custom] are incompatible on the
same setter: %s.%s', interface.name, attribute.name) | 202 raise Exception('[CrossOrigin] and [Custom] are incompatible on the
same setter: %s.%s', interface.name, attribute.name) |
| 205 if context['is_per_world_bindings']: | 203 if context['is_per_world_bindings']: |
| 206 raise Exception('[CrossOrigin] and [PerWorldBindings] are incompatib
le: %s.%s', interface.name, attribute.name) | 204 raise Exception('[CrossOrigin] and [PerWorldBindings] are incompatib
le: %s.%s', interface.name, attribute.name) |
| 207 if context['constructor_type']: | 205 if context['constructor_type']: |
| 208 raise Exception('[CrossOrigin] cannot be used for constructors: %s.%
s', interface.name, attribute.name) | 206 raise Exception('[CrossOrigin] cannot be used for constructors: %s.%
s', interface.name, attribute.name) |
| 209 | 207 |
| 210 return context | 208 return context |
| 211 | 209 |
| 212 | 210 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 lambda self: strip_suffix(self.base_type, 'Constructor')) | 557 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 560 | 558 |
| 561 | 559 |
| 562 def is_constructor_attribute(attribute): | 560 def is_constructor_attribute(attribute): |
| 563 # FIXME: replace this with [ConstructorAttribute] extended attribute | 561 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 564 return attribute.idl_type.name.endswith('Constructor') | 562 return attribute.idl_type.name.endswith('Constructor') |
| 565 | 563 |
| 566 | 564 |
| 567 def update_constructor_attribute_context(interface, attribute, context): | 565 def update_constructor_attribute_context(interface, attribute, context): |
| 568 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 566 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |