Proposal: Modify automatic semicolon insertion in strict mode

Yuh-Ruey Chen maian330 at
Sun Dec 7 19:22:02 PST 2008

Eric Suen wrote:
> Your proposal make nosense to me, first, I not sure what is your
> strict mode means, because in strict mode there is no automatic
> semicolon insertion.
> in must examples you give there is no automatic semicolon insertion,
> your proposal make thing even worse, these are just different coding
> style, for examples, for long expression, it could be:
> a +
>   b
> or
> a
>   + b
> and
> a
>  +
>  b
> if this will cause syntax error, I think no one will use JavaScript...

Yes, it will make currently valid coding styles invalid, but that's for
the sake of a clean grammar. I modeled my rules off what Ruby allows,
and I haven't really heard Ruby authors complaining about those rules.
If what you said was true, then Ruby would not be growing in popularity,
even if it has a different language genealogy.

I can envision two clean options for strict mode:
1) mandating semicolons
2) modifying automatic semicolon insertion along the lines of what I propose

I'm fine with either.

More information about the Es-discuss mailing list