Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uglified code breaks with --comments all #112

Closed
vierbergenlars opened this issue Feb 4, 2013 · 0 comments · Fixed by #2633
Closed

Uglified code breaks with --comments all #112

vierbergenlars opened this issue Feb 4, 2013 · 0 comments · Fixed by #2633

Comments

@vierbergenlars
Copy link

When running uglifyjs 2.2.4 with -b --comments all, the output ends up with a newline after a return statement. This results in unwanted code being executed.

Reduced testcase: https://gist.github.com/4707430#file-commented-js

There should not be a newline between line 8 & 9

I realize this is really an edge case, but it breaks code. That's something a minifier should never do.

@mishoo mishoo closed this as completed in 719a8fd Feb 5, 2013
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Dec 21, 2017
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Dec 21, 2017
alexlamsl added a commit that referenced this issue Dec 21, 2017
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants