- From: David Flanagan <dflanagan@mozilla.com>
- Date: Fri, 20 May 2011 15:17:37 -0700
- To: public-script-coord@w3.org
Are there any DOM interfaces that define index getters that do not also
define length properties?
If not, how about removing the length property from the interface and
making it one of the "supported property indices"? Webkit browsers
already seem to do it this way. (e.g. for a NodeList n,
n.hasOwnProperty("length") is true).
My experience is implementing NodeList in pure JavaScript (using
Proxy.create()). The Proxy object knows the length of the list and
could return it. But if it has to allow the NodeList.prototype.length
getter function to return the value the implementation becomes more
complex and requires a WeakMap in addition to the Proxy object.
Since there is already browser incompatibility out there, could we
standardize the implementation technique that is easier?
David
Received on Friday, 20 May 2011 22:18:06 UTC