Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 2647643002: Fix V8 bindings for named constructors to set prototype object correctly (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 'is_custom_element_callbacks': is_custom_element_callbacks, 148 'is_custom_element_callbacks': is_custom_element_callbacks,
149 # TODO(yukishiino): Make all DOM attributes accessor-type properties. 149 # TODO(yukishiino): Make all DOM attributes accessor-type properties.
150 'is_data_type_property': is_data_type_property(interface, attribute), 150 'is_data_type_property': is_data_type_property(interface, attribute),
151 'is_getter_raises_exception': # [RaisesException] 151 'is_getter_raises_exception': # [RaisesException]
152 'RaisesException' in extended_attributes and 152 'RaisesException' in extended_attributes and
153 extended_attributes['RaisesException'] in (None, 'Getter'), 153 extended_attributes['RaisesException'] in (None, 'Getter'),
154 'is_keep_alive_for_gc': keep_alive_for_gc, 154 'is_keep_alive_for_gc': keep_alive_for_gc,
155 'is_lenient_this': 'LenientThis' in extended_attributes, 155 'is_lenient_this': 'LenientThis' in extended_attributes,
156 'is_nullable': idl_type.is_nullable, 156 'is_nullable': idl_type.is_nullable,
157 'is_explicit_nullable': idl_type.is_explicit_nullable, 157 'is_explicit_nullable': idl_type.is_explicit_nullable,
158 'is_named_constructor': is_named_constructor_attribute(attribute),
158 'is_partial_interface_member': 159 'is_partial_interface_member':
159 'PartialInterfaceImplementedAs' in extended_attributes, 160 'PartialInterfaceImplementedAs' in extended_attributes,
160 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, 161 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
161 'is_put_forwards': 'PutForwards' in extended_attributes, 162 'is_put_forwards': 'PutForwards' in extended_attributes,
162 'is_read_only': attribute.is_read_only, 163 'is_read_only': attribute.is_read_only,
163 'is_reflect': is_reflect, 164 'is_reflect': is_reflect,
164 'is_replaceable': 'Replaceable' in attribute.extended_attributes, 165 'is_replaceable': 'Replaceable' in attribute.extended_attributes,
165 'is_save_same_object': is_save_same_object, 166 'is_save_same_object': is_save_same_object,
166 'is_static': attribute.is_static, 167 'is_static': attribute.is_static,
167 'is_url': 'URL' in extended_attributes, 168 'is_url': 'URL' in extended_attributes,
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 return (not attribute.is_read_only and 547 return (not attribute.is_read_only and
547 'Custom' in extended_attributes and 548 'Custom' in extended_attributes and
548 extended_attributes['Custom'] in [None, 'Setter']) 549 extended_attributes['Custom'] in [None, 'Setter'])
549 550
550 551
551 ################################################################################ 552 ################################################################################
552 # Constructors 553 # Constructors
553 ################################################################################ 554 ################################################################################
554 555
555 idl_types.IdlType.constructor_type_name = property( 556 idl_types.IdlType.constructor_type_name = property(
556 # FIXME: replace this with a [ConstructorAttribute] extended attribute
557 lambda self: strip_suffix(self.base_type, 'Constructor')) 557 lambda self: strip_suffix(self.base_type, 'Constructor'))
558 558
559 559
560 def is_constructor_attribute(attribute): 560 def is_constructor_attribute(attribute):
561 # FIXME: replace this with [ConstructorAttribute] extended attribute
562 return attribute.idl_type.name.endswith('Constructor') 561 return attribute.idl_type.name.endswith('Constructor')
563 562
564 563
564 def is_named_constructor_attribute(attribute):
565 return attribute.idl_type.name.endswith('ConstructorConstructor')
566
567
565 def update_constructor_attribute_context(interface, attribute, context): 568 def update_constructor_attribute_context(interface, attribute, context):
566 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 569 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698