let and strict mode

Kevin Smith khs4473 at gmail.com
Fri Nov 16 05:55:29 PST 2012


> Another experiment would tell us more...and as Peter points out, there are
> people who like to put their declarator keyword on a separate line.
>

Mmm... I think a [no LineTerm] restriction is going to bite too hard in
this case.  If "let" in non-strict mode were a context-sensitive keyword,
with a restriction that limits the lookahead to first tokens in binding
patterns, what kind of code would break?

    <some arbitrary statement or nothing> let
    (ident | "{" | "[") <some sequence of tokens>

So the only code that would break would be expression statements consisting
of the single identifier "let", followed by an ASI'd newline.  Is that
right?

If there's any working code out there like that, then it deserves to break
: )

- Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121116/cc6830e1/attachment.html>


More information about the es-discuss mailing list