Update on ES3.1 block scoped function declarations
Mark S. Miller
erights at google.com
Thu Jul 10 13:28:51 PDT 2008
On Thu, Jul 10, 2008 at 11:05 AM, Brendan Eich <brendan at mozilla.org> wrote:
So what would this program print in ES3.1?
>
> const C = 42;
> function f(x, y) {
> const C = 33;
> if (x) {
> const C = 21;
> return eval(y);
> }
> return C;
> }
> print(f(true, "C"));
>
21
What does it print in ES4-opt-in?
>
> > In a latter revision, we would expect to also add block-scoped let
> > declaration to enable block scoped variables.
> >
> "latter revision" is spelled E-S-4 :-P.
>
;)
Kidding aside, if we could somehow agree on one language, I would want it to
have ES4-opt-in's "let".
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080710/a8747244/attachment-0002.html
More information about the Es4-discuss
mailing list