> That's specified more clearly in the Es 3.1 draft, actually. I was quoting the 3.1 draft from November (which had no substantive changes from the 262 standard); do you have a link for a newer one?
And agreed, it would very weird indeed -- weird and, from an engineering standpoint, JPW (Just Plain Wrong). But easily tested (your code is exactly what I had in mind) just to make sure none of the current implementations is weird and JPW. -- T.J. :-) On Mar 12, 10:52 am, Tobie Langel <[email protected]> wrote: > > It seems to me the spec on the first behavior is a bit less clear > > (Section 15.3.4.3): "If argArray is either an array or an arguments > > object, the function is passed the (ToUint32(argArray.length)) > > arguments argArray[0], argArray[1], ..., argArray[ToUint32 > > (argArray.length)–1]". That doesn't necessarily completely rule out > > actually using the passed-in array to accomplish that, but I can't > > *imagine* an implementation doing it (talk about dodgy practice). If > > none of the current implementations do (which is easily checked; mod > > the array in the called function and look for the effect in the > > caller), it doesn't seem like anything to worry about. > > That's specified more clearly in the Es 3.1 draft, actually. But it > still does imply that a FormalParameterList is built using the array > items. > > Also, if it wasn't the case, you would get extremely weird behaviour > like the following: > > var myArray = [1, 2, 3, 4]; > function foo(a, b, c, d) { > a = b = c = d = 0; > // or: arguments[0] = arguments[1] ... = 0;} > > foo.apply(null, myArray); > myArray; > > >>> [0, 0, 0, 0] > > Clearly not an option. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
