W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Adding ECMAScript 5 array extras to HTMLCollection

From: And Clover <and-py@doxdesk.com>
Date: Tue, 03 Aug 2010 00:10:54 +0200
Message-ID: <4C57426E.4090909@doxdesk.com>
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/
Received on Monday, 2 August 2010 15:10:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:59 UTC