google / closure-linter

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

adds illegal semicolon when a function is assigned to a variable in the middle of statements #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. write javascript code like
for exameple, if you `fixjsstyle` some code such as
```javascript
var a = 1,
    b = 3,
    c = {},
    d = function() {},
    e = "asdf";

the result will look like this. var a = function() {}, b = "asdf";

  1. run fixjsstyle

expected result: var a = function() {}, b = 'asdf';

but I get var a = function() {};, b = 'asdf';

due to that semicolon before comma(,) the result is wrong.

linux closure-linter 2.2.6

i attach a patch here.

Thank you


Original issue reported on code.google.com by `mr.gal...@gmail.com` on 19 Jan 2015 at 9:40

Attachments:
* [ecmalintrules.patch](https://storage.googleapis.com/google-code-attachments/closure-linter/issue-87/comment-0/ecmalintrules.patch)
pepa65 commented 8 years ago

Yes, the fixer should never insert a semicolon before a comma.