jeremykohn / closure-linter

Automatically exported from code.google.com/p/closure-linter
Apache License 2.0
0 stars 0 forks source link

Bad parsing of files starting with double quotes #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Save the following script to test.js:
"use strict";
var a = 1 + 2;
alert(a);

2. Run
fixjsstyle test.js  [--strict]

3. The double quotes are miss-fixed. We get:
"'use strict';
var a = 1 + 2;
alert(a);

Instead of:
'use strict';
var a = 1 + 2;
alert(a);

What version of the product are you using?
closure_linter-2.3

This only happens when the file starts by a double quote. If there's anything 
else before, such as a space or a breakline, the quotes are fixed correctly.

Original issue reported on code.google.com by edo999 on 24 May 2011 at 8:13

GoogleCodeExporter commented 9 years ago
Whoops. This is a subtle bug in our error fixer, which keeps a reference to the 
first token in the file so that when we're done fixing errors we can iterate 
from that point on to write out the correct token stream. We don't update that 
when we delete the first token. We'll get this fixed in the next release.

Thanks for reporting!

Original comment by a...@google.com on 9 Jun 2011 at 3:25

GoogleCodeExporter commented 9 years ago
Fixed in GJsLint 2.3.6. Thanks for the bug report. Sorry it took so long to fix.

Original comment by a...@google.com on 13 Jul 2012 at 10:52

GoogleCodeExporter commented 9 years ago
gjslint of 2.3.6 kills my windows7 OS process.

Original comment by tomonori...@gmail.com on 17 Jul 2012 at 8:50