Keean Schupke
Keean Schupke
The parser now has an implementation of the indentation aware parser described in this paper: https://pdfs.semanticscholar.org/cd8e/5faaa60dfa946dd8a79a5917fe52b4bd0346.pdf Here's the implementation of the indentation parser: ``` js function IndentationParser(init) { this.indent =...
The main reason to use `function` is backwards compatibility, not all browsers support `=>` yet. With regards to our syntax, function definition should be an expression, so you should be...
Regarding semi-colons, Douglas Crockford in "JavaScript: The Good Parts" recommends always using semi-colons explicitly because JavaScripts semi-colon insertion can result in the code not doing what you intended.
I think you are right about '=>' for functions, as it is running in Node which supports them, however, I don't think porting will be that straightforward, as we won't...
Regarding semi-colons: > ... the specification is clear about this. JavaScript’s syntactic grammar specifies that semi-colons are required. Omitting semi-colons results in invalid JavaScript code. That code won’t throw (thanks...
Also jshint wants you to put them in, and I am using jshint as part of the build process. jshint catches the above error :-)
without semi-colons JSHint cannot recognise the above error because you might mean: ``` return; some long stuff ``` or ``` return some long stuff; ```
JavaScript was never designed to be used without semi-colons... lets design our new language not to require them, but I don't see any point in fighting JavaScript... We will emit...
So here's what the guy that created JS thinks: https://brendaneich.com/2012/04/the-infernal-semicolon/
> The moral of this story: ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will...