Why doesn't Function have something like apply that does the same as
in a new expression, i.e. allocate-init-and-apply? To put it another
way: given arguments in an array, I want to write:

F.thisThing(args) and have it mean the same as new F(args[0], args[1],
... args[n-1])

Or is what happens behind the veil of object creation detailed enough
that I can write a facsimile of it with apply? I guess something like:

var x = {};
x.prototype = F.prototype;
x = F.apply(x, args) || x;

But why force me to guess? No doubt I am wrong.

Dominic

On Mon, Mar 10, 2008 at 7:38 PM, Jon Zeppieri <[EMAIL PROTECTED]> wrote:
> On 3/10/08, Lars Hansen <[EMAIL PROTECTED]> wrote:
>  > First draft of the spec for the Function class.  Please comment.
>  >
>
>  Suggestion: deprecate the Function constructor and static invoke().
>
>  Almost all of its uses are better handled by function expressions and,
>  in those cases where eval() in required, one can use eval().
>
>  -Jon
>
>
> _______________________________________________
>  Es4-discuss mailing list
>  [email protected]
>  https://mail.mozilla.org/listinfo/es4-discuss
>
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to