What Sam said. There's no need to hork 'let' just because of a lack of version or strict-mode opt-in. It's still sane, unlike 'var'. Leibniz agrees ;-).

/be

Andy Wingo <mailto:[email protected]>
January 31, 2012 6:30 AM
Hello ecmascriptians,

I hear that TC39 wants to allow let and const into "classic mode". This
sounds like a bad idea to me, but, ok.

If so, can someone say what these expressions would evaluate to, or the
errors they would raise:

(function (){eval("let x = 10"); return x;})()

(function (){var x = 20; eval("let x = 10"); return x;})()

(function (){let x = 20; eval("let x = 10"); return x;})()

(function (){let x = 20; { eval("let x = 10"); return x;}})()

(function (){let x = 20; eval("var x = 10"); return x;})()

(function (){ { let x = 20; { eval("let x = 10"); return x;}}})()

As Leibniz would have it, let us calculate.

Andy
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to