let and strict mode
allen at wirfs-brock.com
Thu Nov 15 11:49:37 PST 2012
On Nov 15, 2012, at 11:33 AM, Kevin Smith wrote:
> I'm not quite sure how to figure this out from the current draft, but is "let" only available from strict mode code? This is valid under ES5 non-strict via ASI:
No, it is currently spec'ed as a reserved keyword in both regular and strict mode.
This is what TC39 agreed to try when we started down the 1JS path, with the expectation that implementation would explore the compatibility impact.
If necessary, we should be able to make "let" a contextual keyword (only recognized as a statement head) followed by a [no LineTerminator here] in order to take care of the ASI case you show below.
> var let = "123";
> x = "abc";
> So with 1JS in mind, it would seem that "let" would only be a keyword in strict mode.
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss