Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

bug when removing duplicated semicolon in for statement #9

Open
doonfrs opened this issue Jul 12, 2017 · 1 comment
Open

bug when removing duplicated semicolon in for statement #9

doonfrs opened this issue Jul 12, 2017 · 1 comment

Comments

@doonfrs
Copy link

doonfrs commented Jul 12, 2017

Code before packing:
for(var myvar=0,t=0;;){}
Coder After packing
for(var myvar=0,t=0;){}

javascript error:
Uncaught SyntaxError: Unexpected token )

because the second semicolon is part from for statement.

@evanw
Copy link
Owner

evanw commented Jul 13, 2017

It looks like this is a bug with packer itself. I tried that example on http://dean.edwards.name/packer/ and it does indeed introduce a syntax error. You should probably file this bug with the original package instead.

That said, I strongly recommend using a community-supported JavaScript minifier instead of packer. It'll be much better tested and will actually be supported (I'm not actually sure where to file bugs against packer). I personally recommend uglify, which I have been using for quite a while and haven't had any issues like this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants