4 ms·
I don't like referring to this as "automatic semicolon insertion". The behavior you're referring to here is really about line termination/continuation. var
by knowtheory 15y ago
I don't like referring to this as "automatic semicolon insertion". The behavior you're referring to here is really about line termination/continuation.
var a =
42
is only parseable one way because assignment requires an argument.
Javascript just happens to make assumptions with certain kinds of ambiguities, but then, all programming languages do.
- program 15y agoActually that is the name that appears in the ECMAScript official language specification: http://bclary.com/2004/11/07/#a-7.9.1 http://bclary.com/2004/11/07/#a-7.9.1
- knowtheory 15y agothat just makes me a bit depressed then :) Thanks for the reference. I still think this is a general issue, and calling it semicolon insertion confuses the issue :\
- olavk 15y agoWell, it is the combination of semicolon-insertion and restricted productions.