| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 attribute = next(candidate | 317 attribute = next(candidate |
| 318 for candidate in interface.attributes | 318 for candidate in interface.attributes |
| 319 if candidate.name == target_attribute_name) | 319 if candidate.name == target_attribute_name) |
| 320 except StopIteration: | 320 except StopIteration: |
| 321 raise Exception('[PutForward] target not found:\n' | 321 raise Exception('[PutForward] target not found:\n' |
| 322 'Attribute "%s" is not present in interface "%s"' % | 322 'Attribute "%s" is not present in interface "%s"' % |
| 323 (target_attribute_name, target_interface_name)) | 323 (target_attribute_name, target_interface_name)) |
| 324 | 324 |
| 325 if ('Replaceable' in attribute.extended_attributes or | 325 if ('Replaceable' in attribute.extended_attributes or |
| 326 is_constructor_attribute(attribute)): | 326 is_constructor_attribute(attribute)): |
| 327 context['cpp_setter'] = '%sForceSetAttributeOnThis(propertyName, v8Value
, info)' % cpp_name(interface) | 327 context['cpp_setter'] = '%sCreateDataProperty(propertyName, v8Value, inf
o)' % cpp_name(interface) |
| 328 return | 328 return |
| 329 | 329 |
| 330 extended_attributes = attribute.extended_attributes | 330 extended_attributes = attribute.extended_attributes |
| 331 idl_type = attribute.idl_type | 331 idl_type = attribute.idl_type |
| 332 | 332 |
| 333 # [RaisesException], [RaisesException=Setter] | 333 # [RaisesException], [RaisesException=Setter] |
| 334 is_setter_raises_exception = ( | 334 is_setter_raises_exception = ( |
| 335 'RaisesException' in extended_attributes and | 335 'RaisesException' in extended_attributes and |
| 336 extended_attributes['RaisesException'] in [None, 'Setter']) | 336 extended_attributes['RaisesException'] in [None, 'Setter']) |
| 337 # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking] | 337 # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking] |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 return attribute.idl_type.name.endswith('Constructor') | 540 return attribute.idl_type.name.endswith('Constructor') |
| 541 | 541 |
| 542 | 542 |
| 543 def update_constructor_attribute_context(interface, attribute, context): | 543 def update_constructor_attribute_context(interface, attribute, context): |
| 544 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 544 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| 545 # When the attribute name is the same as the interface name, do not generate | 545 # When the attribute name is the same as the interface name, do not generate |
| 546 # callback functions for each attribute and use | 546 # callback functions for each attribute and use |
| 547 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 547 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
| 548 # a callback function in order to hard-code the attribute name. | 548 # a callback function in order to hard-code the attribute name. |
| 549 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 549 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
| OLD | NEW |