Closed GoogleCodeExporter closed 9 years ago
gjslint is improperly reporting a missing semi-colon error after the else, such
that fixjsstyle is now trying to fix this incorrect error.
We should fix this, but if you wanted you can work around the error by using
braces in your else statement.
if (true) {
alert(true);
} else {
alert(false);
}
Original comment by a...@google.com
on 3 Sep 2010 at 3:00
Original comment by a...@google.com
on 3 Sep 2010 at 3:00
Original comment by a...@google.com
on 3 Sep 2010 at 7:13
There is a related error regarding the var keyword:
$> cat with_var.js
var
a = 2,
b = 3;
console.log(a, b);
$> node with_var.js
2 3
$> fixjsstyle with_var.js
Fixed 1 errors in with_var.js
$ cat with_var.js
var;
a = 2,
b = 3;
console.log(a, b);
$> node with_var.js
with_var.js:1
var;
^
SyntaxError: Unexpected token ;
at Module._compile (node.js:457:37)
at Module._loadScriptSync (node.js:468:10)
at Module.loadSync (node.js:338:12)
at Object.runMain (node.js:521:24)
at node.js:751:10
.. or should this be a separate issue ?
Original comment by filip.noetzel
on 13 Sep 2010 at 9:14
It would be better to track this as a separate issue. While they manifest in
the same way (bad missing semi-colon error) their cause within the linter is
different.
Original comment by a...@google.com
on 14 Sep 2010 at 3:18
I've filed issue 10 Bad missing semi-colon error when line ends with var
keyword to track this as a separate issue.
The fix to this issue around the else keyword is already complete and will we
part of the next GJsLint release soon. Hopefully we can fix the var issue in
the release after that.
Original comment by a...@google.com
on 16 Sep 2010 at 1:53
This issue should be fixed in version 2.2.5. Issue 10, split off from this
issue, is still open as of version 2.2.5.
Original comment by a...@google.com
on 17 Sep 2010 at 1:46
Original issue reported on code.google.com by
241...@gmail.com
on 2 Sep 2010 at 4:08