Move length property to the set of supported property indicies?

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?


Received on Friday, 20 May 2011 22:18:06 UTC