Changes between Version 68 and Version 69 of WebKitIDL


Ignore:
Timestamp:
Apr 11, 2012 11:30:26 PM (9 years ago)
Author:
arv@chromium.org
Comment:

Document the ArrayClass IDL attribute

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v68 v69  
    5656 - [#CPPPureInterface CPPPureInterface(i)][[br]]
    5757 - [#CustomReturn CustomReturn(p)][[br]]
     58 - [#ArrayClass ArrayClass(i)][[br]]
    5859 - [#OmitConstructor OmitConstructor, Immutable, MasqueradesAsUndefined, CustomGetOwnPropertySlot, ReplaceableConstructor, ExtendsDOMGlobalObject, IsIndex, V8DoNotCheckSignature, NumericIndexedGetter][[br]]
    5960
     
    16781679Used by ObjC, GObject and CPP bindings only.
    16791680
     1681== [ArrayClass](i) == #ArrayClass
     1682
     1683* [http://dev.w3.org/2006/webapi/WebIDL/#ArrayClass The spec of ArrayClass]
     1684
     1685Summary: Allows an interface to extend JavaScript arrays.
     1686
     1687Usage: [ArrayClass] can be specified on interfaces. An interface may not both have [ArrayClass] and extend another interface.
     1688
     1689The bindings for the interface will have the `[[Prototype]]` of the constructor prototype set to `Array.prototype` which means that the methods defined on JavaScript arrays work on the instances of this interface.
     1690
     1691{{{
     1692// IDL
     1693interface [
     1694    ArrayClass,
     1695    IndexedGetter
     1696] NodeList {
     1697    Node item(in unsigned long index);
     1698    readonly attribute unsigned long length;
     1699}
     1700
     1701// JS
     1702myNodeList instanceof Array  // true
     1703myNodeList.forEach(function(node) { console.log(node_; });
     1704}}}
     1705
    16801706== [OmitConstructor], [Immutable], [MasqueradesAsUndefined], [CustomGetOwnPropertySlot], [ReplaceableConstructor], [ExtendsDOMGlobalObject], [IsIndex], [V8DoNotCheckSignature], [NumericIndexedGetter] == #OmitConstructor
    16811707