Array#indexOf and Array#lastIndexOf question

Brendan Eich brendan at mozilla.com
Sun Jun 14 21:45:17 PDT 2009


On Jun 14, 2009, at 8:24 PM, John-David Dalton wrote:

> I noticed that most Array methods perform [[HasProperty]] checks on
> the index values.
> Array#indexOf and Array#lastIndexOf do not. Firefox 3, Safari 4,
> Chrome 2 all seem to check [[HasProperty]] for Array#indexOf and
> lastIndexOf.
>
> Is this an oversight on the draft or did the browser vendors miss  
> something ?

Browser implementations, starting with Firerfox 1.5 / SpiderMonkey  
(JS1.6), preceded the spec, so the oversight is probably on TC39's  
part. I don't recall this coming up and a rationale for diverging from  
the de-facto standard being given.

/be



More information about the es-discuss mailing list