Open GoogleCodeExporter opened 9 years ago
I observe this issue for missing quotes as well.
var foo = function() {
alert('in function foo.);
return 0;
};
I have tested this with closure-linter 2.2.5 and 2.2.6 using python 2.6 and
python 2.7.
Original comment by stephen....@gmail.com
on 15 Nov 2010 at 2:52
At the very least GJsLint should report an error that the file does not parse,
if not provide a more useful and specific error. It definitely shouldn't error
with an ugly stack trace.
Original comment by a...@google.com
on 15 Nov 2010 at 4:55
Attached is a patch that raises the following behavior:
>>SNIP>>
$ cat baz.js
var foo = function() {
alert('in function foo.);
};
$ python closure_linter/gjslint.py --strict baz.js
----- FILE : baz.js -----
Line 2, E:0130: Multi-line strings are not allowed
Line 3, E:0301: File ended in mode "single_quote_string".
Line 3, E:-002: INTERNAL ERROR: indentation stack is not empty: [
<JavaScriptToken: 1, operator, "=", {}, MetaData(Context(var > statement > root), optype: 'binary')> OVERRIDDEN [by "{"] {is_block: False, is_transient: True},
<JavaScriptToken: 1, {, "{", {}, MetaData(Context(block > var > statement > root))> {is_block: True, is_transient: False},
<JavaScriptToken: 2, (, "(", {}, MetaData(Context(group > statement > block > var > statement > root))> {is_block: False, is_transient: False}]
Found 3 errors, including 0 new errors, in 1 files (0 files OK).
Some of the errors reported by GJsLint may be auto-fixable using the script
fixjsstyle. Please double check any changes it makes and report any bugs. The
script can be run by executing:
fixjsstyle --strict baz.js
<<SNAP<<
I don't think that's a beautiful way to end the program ("INTERNAL ERROR",
etc.) but its way better than blurping out a stacktrace.
Original comment by filip.noetzel
on 20 Feb 2011 at 8:54
Attachments:
Original issue reported on code.google.com by
JayYoung...@gmail.com
on 19 Sep 2010 at 8:23