Comments on Meeting Notes

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Dec 12 08:18:36 PST 2012


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 <brendan at mozilla.com> 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
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121212/9904f812/attachment.html>


More information about the es-discuss mailing list