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