For non-strict functions, formal parameters and the argument object can share the same storage on the processor stack. Strict functions require a copy, if either a formal or an args object element is modified. The conserative implementation is to always copy.
AllenBrendan Eich <[email protected]> wrote:Axel Rauschmayer wrote: > Can you explain? What is this copying price and why don’t non-strict > functions have to pay it? Strict functions have an arguments object that does not alias formal parameters: js> function f(x) { print(x); arguments[0] = 42; return x; } js> f(99) 99 42 js> function g(x) { "use strict"; print(x); arguments[0] = 42; return x; } js> g(99) 99 99 /be _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

