| Index: Source/bindings/scripts/v8_utilities.py
|
| diff --git a/Source/bindings/scripts/v8_utilities.py b/Source/bindings/scripts/v8_utilities.py
|
| index a16af83fb5ad43296d59096660d78062b0e7f5b0..bce4ef5c686d26889bc57c9b6ef7e6ecabce1e15 100644
|
| --- a/Source/bindings/scripts/v8_utilities.py
|
| +++ b/Source/bindings/scripts/v8_utilities.py
|
| @@ -35,7 +35,7 @@ import re
|
|
|
| from idl_types import IdlTypeBase
|
| import idl_types
|
| -from idl_definitions import Exposure, IdlInterface, IdlAttribute, IdlOperation
|
| +from idl_definitions import Exposure, IdlInterface, IdlAttribute
|
| from v8_globals import includes
|
|
|
| ACRONYMS = [
|
| @@ -421,10 +421,25 @@ def on_instance(interface, member):
|
| - [Unforgeable] members
|
| - regular members of [Global] or [PrimaryGlobal] interfaces
|
| """
|
| - # TODO(yukishiino): Implement this function following the spec.
|
| if member.is_static:
|
| return False
|
| - return not on_prototype(interface, member)
|
| +
|
| + # TODO(yukishiino): Remove a hack for toString once we support
|
| + # Symbol.toStringTag.
|
| + if (interface.name == 'Window' and member.name == 'toString'):
|
| + return False
|
| +
|
| + # TODO(yukishiino): Implement "interface object" and its [[Call]] method
|
| + # in a better way. Then we can get rid of this hack.
|
| + if is_constructor_attribute(member):
|
| + return True
|
| +
|
| + if ('PrimaryGlobal' in interface.extended_attributes or
|
| + 'Global' in interface.extended_attributes or
|
| + 'Unforgeable' in member.extended_attributes or
|
| + 'Unforgeable' in interface.extended_attributes):
|
| + return True
|
| + return False
|
|
|
|
|
| def on_prototype(interface, member):
|
| @@ -433,26 +448,29 @@ def on_prototype(interface, member):
|
|
|
| Most members are defined on the prototype object. Exceptions are as
|
| follows.
|
| - - constant members
|
| - static members (optional)
|
| - [Unforgeable] members
|
| - members of [Global] or [PrimaryGlobal] interfaces
|
| - named properties of [Global] or [PrimaryGlobal] interfaces
|
| """
|
| - # TODO(yukishiino): Implement this function following the spec.
|
| -
|
| - # These members must not be placed on prototype chains.
|
| - if (is_constructor_attribute(member) or
|
| - member.is_static or
|
| - is_unforgeable(interface, member)):
|
| + if member.is_static:
|
| return False
|
|
|
| - # TODO(yukishiino): We should handle [Global] and [PrimaryGlobal] instead of
|
| - # Window.
|
| - if (interface.name == 'Window'):
|
| - return (member.idl_type.name == 'EventHandler' or
|
| - type(member) == IdlOperation)
|
| + # TODO(yukishiino): Remove a hack for toString once we support
|
| + # Symbol.toStringTag.
|
| + if (interface.name == 'Window' and member.name == 'toString'):
|
| + return True
|
| +
|
| + # TODO(yukishiino): Implement "interface object" and its [[Call]] method
|
| + # in a better way. Then we can get rid of this hack.
|
| + if is_constructor_attribute(member):
|
| + return False
|
|
|
| + if ('PrimaryGlobal' in interface.extended_attributes or
|
| + 'Global' in interface.extended_attributes or
|
| + 'Unforgeable' in member.extended_attributes or
|
| + 'Unforgeable' in interface.extended_attributes):
|
| + return False
|
| return True
|
|
|
|
|
| @@ -462,10 +480,8 @@ def on_interface(interface, member):
|
| interface object.
|
|
|
| The following members must be defiend on an interface object.
|
| - - constant members
|
| - static members
|
| """
|
| - # TODO(yukishiino): Implement this function following the spec.
|
| if member.is_static:
|
| return True
|
| return False
|
|
|