On Fri, Jan 30, 2009 at 12:19 AM, Garrett Smith <[email protected]>wrote:
> No offense, but that is some ugly code. > Indeed. We wouldn't have written it if the language didn't force us to. > [...] > To supply varargs to that constructor, use a newApply function. > > Function newApply, for a constructor C: > 1) create a dummy function F > 2) assign the C's prototype to F > 3) create a new F, as i > 4) call C.apply(i, arguments) > Your step #3 still fails for the reason I stated earlier: > Won't work on Array, Date, RegExp, and Function, since o is created with > [[Class]] "Object". But should work otherwise. If your technique did work on, for example, Date, then we wouldn't need the ugly code. I suggest you try your ideas on Date. -- Cheers, --MarkM
_______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

