| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 if (is_constructor_attribute(attribute) or | 520 if (is_constructor_attribute(attribute) or |
| 521 attribute.is_static or | 521 attribute.is_static or |
| 522 'Unforgeable' in attribute.extended_attributes or | 522 'Unforgeable' in attribute.extended_attributes or |
| 523 'OverrideBuiltins' in interface.extended_attributes): | 523 'OverrideBuiltins' in interface.extended_attributes): |
| 524 return False | 524 return False |
| 525 | 525 |
| 526 # FIXME: We should move all of the following DOM attributes to prototype | 526 # FIXME: We should move all of the following DOM attributes to prototype |
| 527 # chains. | 527 # chains. |
| 528 if (has_custom_getter(attribute) or | 528 if (has_custom_getter(attribute) or |
| 529 has_custom_setter(attribute) or | 529 has_custom_setter(attribute) or |
| 530 interface.name == 'Window' or | 530 interface.name == 'Window'): |
| 531 v8_utilities.indexed_property_getter(interface) or | |
| 532 v8_utilities.indexed_property_setter(interface) or | |
| 533 v8_utilities.indexed_property_deleter(interface) or | |
| 534 v8_utilities.named_property_getter(interface) or | |
| 535 v8_utilities.named_property_setter(interface) or | |
| 536 v8_utilities.named_property_deleter(interface)): | |
| 537 return False | 531 return False |
| 538 | 532 |
| 539 return is_accessor | 533 return is_accessor |
| 540 | 534 |
| 541 | 535 |
| 542 ################################################################################ | 536 ################################################################################ |
| 543 # Constructors | 537 # Constructors |
| 544 ################################################################################ | 538 ################################################################################ |
| 545 | 539 |
| 546 idl_types.IdlType.constructor_type_name = property( | 540 idl_types.IdlType.constructor_type_name = property( |
| 547 # FIXME: replace this with a [ConstructorAttribute] extended attribute | 541 # FIXME: replace this with a [ConstructorAttribute] extended attribute |
| 548 lambda self: strip_suffix(self.base_type, 'Constructor')) | 542 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 549 | 543 |
| 550 | 544 |
| 551 def is_constructor_attribute(attribute): | 545 def is_constructor_attribute(attribute): |
| 552 # FIXME: replace this with [ConstructorAttribute] extended attribute | 546 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 553 return attribute.idl_type.name.endswith('Constructor') | 547 return attribute.idl_type.name.endswith('Constructor') |
| 554 | 548 |
| 555 | 549 |
| 556 def update_constructor_attribute_context(interface, attribute, context): | 550 def update_constructor_attribute_context(interface, attribute, context): |
| 557 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 551 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| 558 # When the attribute name is the same as the interface name, do not generate | 552 # When the attribute name is the same as the interface name, do not generate |
| 559 # callback functions for each attribute and use | 553 # callback functions for each attribute and use |
| 560 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 554 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
| 561 # a callback function in order to hard-code the attribute name. | 555 # a callback function in order to hard-code the attribute name. |
| 562 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 556 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
| OLD | NEW |