So to sum up:
1. Default parameter expressions are evaluated in the activation scope,
with all formal parameters bound, no use-before-set dead zone (so
formals are var-like), functions hoisted and in scope -- because in this
case, simpler and worse are better.
2. Generator function with default parameters has implicit yield after
defaulting (which per 1 comes after function hoisting) -- because:
let n = 0;
function *gen(a = ++n) {}
for (let x of gen()) {}
assert(n === 1);
This is where I am currently, FWIW.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss