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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 context['cpp_setter'] = '%sCreateDataProperty(propertyName, v8Value, inf
o)' % cpp_name(interface) | 335 context['cpp_setter'] = '%sCreateDataProperty(propertyName, v8Value, inf
o)' % cpp_name(interface) |
336 return | 336 return |
337 | 337 |
338 extended_attributes = attribute.extended_attributes | 338 extended_attributes = attribute.extended_attributes |
339 idl_type = attribute.idl_type | 339 idl_type = attribute.idl_type |
340 | 340 |
341 # [RaisesException], [RaisesException=Setter] | 341 # [RaisesException], [RaisesException=Setter] |
342 is_setter_raises_exception = ( | 342 is_setter_raises_exception = ( |
343 'RaisesException' in extended_attributes and | 343 'RaisesException' in extended_attributes and |
344 extended_attributes['RaisesException'] in [None, 'Setter']) | 344 extended_attributes['RaisesException'] in [None, 'Setter']) |
345 # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking] | 345 # [LegacyInterfaceTypeChecking] |
346 has_type_checking_interface = ( | 346 has_type_checking_interface = ( |
347 not is_legacy_interface_type_checking(interface, attribute) and | 347 not is_legacy_interface_type_checking(interface, attribute) and |
348 idl_type.is_wrapper_type) | 348 idl_type.is_wrapper_type) |
349 | 349 |
350 context.update({ | 350 context.update({ |
351 'has_setter_exception_state': | 351 'has_setter_exception_state': |
352 is_setter_raises_exception or has_type_checking_interface or | 352 is_setter_raises_exception or has_type_checking_interface or |
353 idl_type.v8_conversion_needs_exception_state, | 353 idl_type.v8_conversion_needs_exception_state, |
354 'has_type_checking_interface': has_type_checking_interface, | 354 'has_type_checking_interface': has_type_checking_interface, |
355 'is_setter_call_with_execution_context': has_extended_attribute_value( | 355 'is_setter_call_with_execution_context': has_extended_attribute_value( |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return attribute.idl_type.name.endswith('Constructor') | 508 return attribute.idl_type.name.endswith('Constructor') |
509 | 509 |
510 | 510 |
511 def update_constructor_attribute_context(interface, attribute, context): | 511 def update_constructor_attribute_context(interface, attribute, context): |
512 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 512 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
513 # When the attribute name is the same as the interface name, do not generate | 513 # When the attribute name is the same as the interface name, do not generate |
514 # callback functions for each attribute and use | 514 # callback functions for each attribute and use |
515 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 515 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
516 # a callback function in order to hard-code the attribute name. | 516 # a callback function in order to hard-code the attribute name. |
517 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 517 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
OLD | NEW |