ES3.1 Draft: Array generics

Pratap Lakshman (VJ#SDK) pratapl at microsoft.com
Sun Jun 8 14:50:28 PDT 2008


Garrett,
I apologize.
I was not ignoring you. Yes, I am interested in feedback!

The initial Array generics proposal did not include the thisObj param as it was felt that it could open the door to some security issues. We were even contemplating cutting Array generics from ES3.1 altogether. Later, based on feedback from many of us on the discuss lists, we are going back to specifying the Array Generics to include the "thisObj" param; these generics will be available on Array.prototype. I am currently revising the proposal, and it will include the following:
Array.prototype.indexOf
Array.prototype.lastIndexOf
Array.prototype.every
Array.prototype.some
Array.prototype.forEach
Array.prototype.map
Array.prototype.filter

and also,
Array.prototype.reduce
Array.prototype.reduceRight

I am not sure how you got unsubscribed; there must be some mistake!

pratap

-----Original Message-----
From: es4-discuss-bounces at mozilla.org [mailto:es4-discuss-bounces at mozilla.org] On Behalf Of Garrett Smith
Sent: Sunday, June 08, 2008 8:43 AM
To: es4-discuss at mozilla.org
Subject: Fwd: ES3.1 Draft: Array generics

Hello Pratap,

Were you genuinely interested in feedback?

Is Function described by Type in ES3.1?

Are top-level generics part of the spec (Array.forEach)?

You or one of your colleagues signed me up for the ES3.1 list, then,
apparently, after I replied directly to you, decided to ignore the
reply and unsubscribed me from the list. I can't be bothered to
resubscribe myself. Posted to ES4 discuss.

Garrett

---------- Forwarded message ----------
From:  <es3.x-discuss-owner at mozilla.org>
Date: Sat, May 31, 2008 at 6:27 PM
Subject: Fwd: ES3.1 Draft: Array generics
To: dhtmlkitchen at gmail.com


Messages from non-subscribers are automatically rejected. Please
subscribe to the list first before attempting to post, or ensure that
you are posting using the address you subscribed with.



---------- Forwarded message ----------
From: "Garrett Smith" <dhtmlkitchen at gmail.com>
To: "es3.x-discuss at mozilla.org" <es3.x-discuss at mozilla.org>,
"es4-discuss at mozilla.org" <es4-discuss at mozilla.org>
Date: Sat, 31 May 2008 18:27:10 -0700
Subject: Fwd: ES3.1 Draft: Array generics
fwd to list.


On Sat, May 31, 2008 at 1:44 AM, Garrett Smith <dhtmlkitchen at gmail.com> wrote:
> 2008/5/19 Pratap Lakshman (VJ#SDK) <pratapl at microsoft.com>:

> It would be sufficient and more correct to say: "throw a TypeError"
> rather than "throw a TypeError exception"
>

So it should probably read one of:-

1) If callbackfn does not implement [[Call]], throw a TypeError.
2) If callbackfn is not a function, throw a TypeError

There is also an absence of top-level generics:-

Array.forEach

- This avoids having to write:-

[].forEach.call( nodeList, fun );

Note on host objects:
Whether the forEach function can be applied successfully to a host
object is implementation -dependent.
- support Array Generics for host object, for example, a DOM NodeList
in abstract view.

[].sort.call( ul.getElementsByTagName("li"), byName );

Garrett

> Regards,
>
> Garrett
>
>> pratap
>>
_______________________________________________
Es4-discuss mailing list
Es4-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss



More information about the Es4-discuss mailing list