Mark S. Miller wrote:
I actually prefer #3. Given only knowledge of ES5 and of the rest of
ES6, I find it least surprising. "var"s hoist out of blocks. In
non-strict code, "function"s leak out of blocks in ways that are hard
to explain. I can understand non-strict direct eval as being
block-like, in that "var" and "function" leak out of them, but all the
reliably block-local declarations stay within the direct eval.
Also, I buy the refactoring issue. It's like the problem with
micro-modes: bizarre and unexpected non-local influences.
Yes, agree on #3 being best. My recollection from past TC39 meetings and
discussion here is that #2 will not fly. We do not want some let buried
in a large string to eval to contaminate the whole eval'ed program such
that vars in it are confined, where they weren't before.
Just amplifying your refactoring point, but also noting your
micro-mode/non-local comment. This is not going to win consensus.
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss