Proposal: Modify automatic semicolon insertion in strict mode

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Fri Dec 12 10:49:13 PST 2008


P T Withington wrote:
> On 2008-12-11, at 13:26EST, Brendan Eich wrote:
> 
>> Is it really too onerous (upon implementors) for strict mode to make
>> case (1) an error?
> 
> I think Joe the Hacker would be most happy if there were a mode (it
> might be called strict) where the parser would say:
> 
> "Joe, you wrote two lines of code here that the previous administration
> would have inserted a semicolon between without even consulting you, but
> which I know could actually go either way.  May I suggest that you
> either insert the semicolon yourself, move the newline, or add some
> parens, so I don't have to worry about what was you might have actually
> meant?"

That is precisely what the filter I suggested provides. Of course the
same check could be implemented as a compiler warning.

-- 
David-Sarah Hopwood


More information about the Es-discuss mailing list