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