ES3.1 Draft: Array generics

Garrett Smith dhtmlkitchen at
Sun Jun 8 21:20:14 PDT 2008

On Sun, Jun 8, 2008 at 2:50 PM, Pratap Lakshman (VJ#SDK)
<pratapl at> wrote:
> Garrett,
> I apologize.
> I was not ignoring you. Yes, I am interested in feedback!

OK, but you seem to have misunderstood me.

> 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.filter
> and also,
> Array.prototype.reduce
> Array.prototype.reduceRight

I meant the top-level generics:

Array.forEach(arrayLike, fn);

It was not my argument for:

Array.prototype.forEach(fn[, thisArg]);

The thisArg was what Erik had brought up.

The other question was regarding the:
"If Type(callbackfn) is not a function, throw a TypeError exception."

ES 3.0 doesn't define "Function" as a Type. In fact, the spec often
uses: If "x is a Function". There is: "if Type(x) is Number", but not
"if Type(x) is Function". That is why I asked if ES 3.1 defines
Function for Type(). Does it?
ES 3.1: Type, section 8

If ES 3.0 had forEach, it would probably have read something along the
lines of one of:
1) If callbackfn does not implement [[Call]], throw a TypeError.
2) If callbackfn is not a function, throw a TypeError.

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

I don't know either. Is there a link to get back on?


> pratap

More information about the Es4-discuss mailing list