issue: function hoisting and parameter default value initialization

Kevin Smith khs4473 at gmail.com
Mon Oct 8 19:24:28 PDT 2012


> function f(x1, ~~~, xN) {
>     if (x1 === undefined) x1 = e1;
>     ~~~
>     if (xN === undefined) xN = eN;
>     return (function(x1, ~~~ xN) { body }).apply(this, arguments);
> }
>

Effectively sibling scopes, with a copy mechanism from the "defaults" scope
to the "body" scope.  That's what I was going for originally but I wasn't
clever enough to see a natural desugaring implementation.  Neat!

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121008/6f6d5b97/attachment.html>


More information about the es-discuss mailing list