Array#indexOf and Array#lastIndexOf question

View: New views
3 Messages — Rating Filter:   Alert me  

Array#indexOf and Array#lastIndexOf question

by jdalton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 ?

- John-David Dalton
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

Re: Array#indexOf and Array#lastIndexOf question

by Brendan Eich-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

RE: Array#indexOf and Array#lastIndexOf question

by Allen Wirfs-Brock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Agreed...I'll fix it.

>-----Original Message-----
>From: es-discuss-bounces@... [mailto:es-discuss-
>bounces@...] On Behalf Of Brendan Eich
>Sent: Sunday, June 14, 2009 9:45 PM
>To: John-David Dalton
>Cc: es-discuss@...
>Subject: Re: Array#indexOf and Array#lastIndexOf question
>
>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
>
>_______________________________________________
>es-discuss mailing list
>es-discuss@...
>https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss