make comments output more robust (#2633)
authorAlex Lam S.L <alexlamsl@gmail.com>
Thu, 21 Dec 2017 20:59:54 +0000 (04:59 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Dec 2017 20:59:54 +0000 (04:59 +0800)
commitedb4e3bd52e1623425927a7d63963ba3b87a3ec2
treeace997f3450683da280f4031b224ed6628ab79a7
parent4113609dd4d782f0ceb9ec1c3e9c829e05a93aed
make comments output more robust (#2633)

- improve handling of comments right after `return`
- retain comments after `OutputStream`
- preserve trailing comments
- fix handling of new line before comments
- handle comments around parentheses

fixes #88
fixes #112
fixes #218
fixes #372
fixes #2629
lib/ast.js
lib/output.js
lib/parse.js
lib/utils.js
test/compress/pure_funcs.js
test/mocha/comment-filter.js
test/mocha/comment.js