| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 def on_instance(interface, member): | 415 def on_instance(interface, member): |
| 416 """Returns True if the interface's member needs to be defined on every | 416 """Returns True if the interface's member needs to be defined on every |
| 417 instance object. | 417 instance object. |
| 418 | 418 |
| 419 The following members must be defiend on an instance object. | 419 The following members must be defiend on an instance object. |
| 420 - [Unforgeable] members | 420 - [Unforgeable] members |
| 421 - regular members of [Global] or [PrimaryGlobal] interfaces | 421 - regular members of [Global] or [PrimaryGlobal] interfaces |
| 422 - members on which [DoNotExposeJSAccessors] is specified | 422 - members on which [DoNotExposeJSAccessors] is specified |
| 423 """ | 423 """ |
| 424 # TODO(yukishiino): Implement this function following the spec. | 424 # TODO(yukishiino): Implement this function following the spec. |
| 425 if member.is_static: |
| 426 return False |
| 425 return not on_prototype(interface, member) | 427 return not on_prototype(interface, member) |
| 426 | 428 |
| 427 | 429 |
| 428 # [ExposeJSAccessors] | 430 # [ExposeJSAccessors] |
| 429 def on_prototype(interface, member): | 431 def on_prototype(interface, member): |
| 430 """Returns True if the interface's member needs to be defined on the | 432 """Returns True if the interface's member needs to be defined on the |
| 431 prototype object. | 433 prototype object. |
| 432 | 434 |
| 433 Most members are defined on the prototype object. Exceptions are as | 435 Most members are defined on the prototype object. Exceptions are as |
| 434 follows. | 436 follows. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 # static, const | 481 # static, const |
| 480 def on_interface(interface, member): | 482 def on_interface(interface, member): |
| 481 """Returns True if the interface's member needs to be defined on the | 483 """Returns True if the interface's member needs to be defined on the |
| 482 interface object. | 484 interface object. |
| 483 | 485 |
| 484 The following members must be defiend on an interface object. | 486 The following members must be defiend on an interface object. |
| 485 - constant members | 487 - constant members |
| 486 - static members | 488 - static members |
| 487 """ | 489 """ |
| 488 # TODO(yukishiino): Implement this function following the spec. | 490 # TODO(yukishiino): Implement this function following the spec. |
| 491 if member.is_static: |
| 492 return True |
| 489 return False | 493 return False |
| 490 | 494 |
| 491 | 495 |
| 492 ################################################################################ | 496 ################################################################################ |
| 493 # Indexed properties | 497 # Indexed properties |
| 494 # http://heycam.github.io/webidl/#idl-indexed-properties | 498 # http://heycam.github.io/webidl/#idl-indexed-properties |
| 495 ################################################################################ | 499 ################################################################################ |
| 496 | 500 |
| 497 def indexed_property_getter(interface): | 501 def indexed_property_getter(interface): |
| 498 try: | 502 try: |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 except StopIteration: | 588 except StopIteration: |
| 585 return None | 589 return None |
| 586 | 590 |
| 587 | 591 |
| 588 IdlInterface.indexed_property_getter = property(indexed_property_getter) | 592 IdlInterface.indexed_property_getter = property(indexed_property_getter) |
| 589 IdlInterface.indexed_property_setter = property(indexed_property_setter) | 593 IdlInterface.indexed_property_setter = property(indexed_property_setter) |
| 590 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) | 594 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) |
| 591 IdlInterface.named_property_getter = property(named_property_getter) | 595 IdlInterface.named_property_getter = property(named_property_getter) |
| 592 IdlInterface.named_property_setter = property(named_property_setter) | 596 IdlInterface.named_property_setter = property(named_property_setter) |
| 593 IdlInterface.named_property_deleter = property(named_property_deleter) | 597 IdlInterface.named_property_deleter = property(named_property_deleter) |
| OLD | NEW |