Desugaring "for" and "let"

Brendan Eich brendan at mozilla.com
Mon Jul 11 15:04:18 PDT 2011


On Jul 11, 2011, at 2:54 PM, Axel Rauschmayer wrote:

> As per "Jon’s criticism", I would expect every iteration to create a new environment whose outer environment is always the same – the environment where "i" is bound (right?). That is: "i" is stored outside the environments that are created by repeatedly "invoking" the loop body.

Yes, there's an implicit block snugly wrapping the for(let...;...;...){...} loop to hold the let's bindings.

/be


More information about the es-discuss mailing list