3 ms·
So if I get you right, return "something"; is parsed as return; "something"; ??? That's just braindead.
by ifdefdebug 10y ago
So if I get you right,
return
"something";
is parsed as
return;
"something";
??? That's just braindead.
- Tloewald 10y agoYes, but unfortunately you can't go back in time and fix it. What we really need is for an analog of "use strict" (e.g. "use strict semicolons" that either (a) eliminates semicolon insertion from Javascript (and just starts throwing errors) or (imho better) (b) eliminates the semicolon altogether (aside from inside for()). Since a huge proportion of production js is being linted using tools that force semicolon insertion, the first option would be pretty painless. Option b — making newline the semantic replacement for ';' would actually be better, since it prevents atrocities like: function wtf(x){ console.log('wtf', x); } /* newline here; strictly correct js */ ("hello world")