Generator issue: exceptions while initializing arguments

Kevin Smith khs4473 at
Mon Sep 10 13:07:55 PDT 2012

> But as I pointed out, we have problems already in JS:
>   function f(x) {var x; ...}
> the var x restates the formal parameter. It does not shadow it.

Ah - observable here:

    > function crazypants(x) { var x; return x; }
    > crazypants(123);

If it shadowed, we would expect undefined.  Even so, information can only
flow from left to right across the curly boundary.  That's expected.  But
if we allow parameter default expressions to have visibility into the
function body, then we have bidirectional flow across curlies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list