packer icon indicating copy to clipboard operation
packer copied to clipboard

bug when removing duplicated semicolon in for statement

Open doonfrs opened this issue 8 years ago • 1 comments

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.

doonfrs avatar Jul 12 '17 23:07 doonfrs

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.

evanw avatar Jul 13 '17 04:07 evanw