Implicit variable assignments, weird scoping for eval, with and a lot more was also part of JavaScript and is gone in the strict mode. What's your point?
I am talking about parsing. Because it's very damn common to parse programming languages:
string extraction for internationalization
static analysis
implementing an actual interpreter (necessary sometimes)
detecting end of statements for feeding an interactive interpreter
parsing javascript for automatic comment and function signature extraction (documentation tools)
And a lot more. JavaScript is suppose to be a language that is somewhat easy to implement, easy to sandbox and works the same in different interpreters. Semicolon insertion, the weird rules for the regular expression literal, weird rules for function statements versus function expressions and more are standard features that often work different in different implementations of ECMAScript. You will run on different implementations, for that the language is just too damn common.
So save yourself the trouble and write with semicolons. A lot of tools will not do the extra trouble and implement semicolon insertion. And if they do, chances are they do it wrong and might choke on your code.
2
u/mitsuhiko Feb 06 '11
For understanding why virtual semicolon insertion is retarded.