Chromium Code Reviews| Index: Source/bindings/scripts/v8_attributes.py |
| diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py |
| index 617bc3dfe7ee5627e600208fc0e4b34cf9c0045f..da3812ec7391be8b4d40b8db6791167cc6758beb 100644 |
| --- a/Source/bindings/scripts/v8_attributes.py |
| +++ b/Source/bindings/scripts/v8_attributes.py |
| @@ -101,7 +101,7 @@ def attribute_context(interface, attribute): |
| 'is_call_with_script_state': v8_utilities.has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'), |
| 'is_check_security_for_node': is_check_security_for_node, |
| 'is_custom_element_callbacks': is_custom_element_callbacks, |
| - 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes, |
| + 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute), |
| 'is_getter_raises_exception': # [RaisesException] |
| 'RaisesException' in extended_attributes and |
| extended_attributes['RaisesException'] in (None, 'Getter'), |
| @@ -475,6 +475,37 @@ def has_custom_setter(attribute): |
| extended_attributes['Custom'] in [None, 'Setter']) |
| +# [ExposeJSAccessors] |
| +def is_expose_js_accessors(interface, attribute): |
| + extended_attributes = attribute.extended_attributes |
| + |
| + # These attributes must not be accessors on prototype chains. |
| + if (attribute.is_static or |
| + 'Unforgeable' in extended_attributes or |
| + 'OverrideBuiltins' in interface.extended_attributes): |
| + return False |
| + # Explicitly specified as accessors with the extended attribute. |
| + if 'ExposeJSAccessors' in extended_attributes: |
|
haraken
2015/03/11 03:19:32
You can now remove this IDL attribute.
Yuki
2015/03/11 08:44:36
Done.
|
| + return True |
| + |
| + # FIXME: We should move all of the following DOM attributes to prototype |
| + # chains. |
| + if (is_constructor_attribute(attribute) or |
| + has_custom_getter(attribute) or |
| + has_custom_setter(attribute) or |
| + interface.name == 'Window' or |
| + interface.name == 'WorkerGlobalScope' or |
| + v8_utilities.indexed_property_getter(interface) or |
| + v8_utilities.indexed_property_setter(interface) or |
| + v8_utilities.indexed_property_deleter(interface) or |
| + v8_utilities.named_property_getter(interface) or |
| + v8_utilities.named_property_setter(interface) or |
| + v8_utilities.named_property_deleter(interface)): |
| + return False |
| + |
| + return True |
| + |
| + |
| ################################################################################ |
| # Constructors |
| ################################################################################ |