660 | | == `[V8Unforgeable]`(m,a), `[V8OnProto]`(m,a) == #V8Unforgeable |
661 | | |
662 | | * [http://dev.w3.org/2006/webapi/WebIDL/#Unforgeable The spec of Unforgeable] |
663 | | |
664 | | Summary: They control where a getter/setter of a given attribute is defined. |
665 | | |
666 | | Usage: They can be specified on methods or attributes: |
667 | | {{{ |
668 | | [V8Unforgeable] void func(); |
669 | | attribute [V8OnProto] DOMString str; |
670 | | }}} |
671 | | |
672 | | By default in JSC and V8, attribute getters/setters are defined on a DOM object, and methods are defined on a prototype chain |
673 | | (although the Web IDL spec requires that both attribute getters/setters and methods should be defined on a prototype chain). |
674 | | |
675 | | If you want to explicitly control where an attribute getter/setter or a method is defined in V8, |
676 | | you can use `[V8Unforgeable]` or `[V8OnProto]`. |
677 | | |
678 | | * `[V8Unforgeable]` indicates that an attribute getter/setter or a method should be defined on a DOM object. |
679 | | * `[V8OnProto]` indicates that an attribute getter/setter or a method should be defined on a prototype chain. |
680 | | |
681 | | Note: As explained above, the current implementation of JSC and V8 is wrong with the Web IDL spec, |
682 | | and `[V8Unforgeable]` and `[V8OnProto]` are used for hack. |
683 | | You should not use them unless you have a strong reason to use them. |
684 | | |