[whatwg] Adding ECMAScript 5 array extras to HTMLCollection

And Clover and-py at doxdesk.com
Mon Aug 2 15:10:54 PDT 2010


On 08/02/2010 09:57 PM, Garrett Smith wrote:

> Can it be argued as to what "integer index" means? And what is a "string index"?

Good catch, that's pretty ambiguous language. Browsers implement this as 
if "integer index" were equal to the term "array index" defined section 
15.4 of ECMA262 (that is an unsigned 32-bit integer other than 
(1<<32)-1, expressed in simplest-possible decimal form), and "string 
index" meaning any other index.

The paragraph should be updated to explicitly reference this; probably 
the language about square brackets should be dropped too, as it seems to 
represent a misunderstanding of exactly how the ECMAScript 
square-bracket and dot operators actually work.

Whether a property name is an "array index" or not is an unrelated issue 
to the matter of how the property value is retrieved. OK, you can't use 
the direct dot syntax on an array index purely as a grammatical manner, 
but . and [] aren't the only way to access properties. (eg. 
document.links.hasOwnProperty('0').)

-- 
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the whatwg mailing list