minify icon indicating copy to clipboard operation
minify copied to clipboard

template literals and handling of missing semi-colons

Open futtta opened this issue 4 years ago • 3 comments

When normal JS vars are on separate lines with missing semi-colons, they are left on separate lines, but when using template literals the line-break is removed resulting in broken JS.

JS in;

// template literals without semicolons
var foo = `Hello`
foo = `world`

// template literals with semicolons
var foo = `Hello`;
foo = `world`;

// Simple strings without semicolons
var foo = 'Hello'
foo = 'world'

JS out:

var foo=`Hello`foo=`world`var foo=`Hello`;foo=`world`;var foo='Hello'
foo='world';

futtta avatar Jul 12 '20 05:07 futtta

you are reporting to the wrong project. I think you need to report "mrclay/jsmin-php":

  • https://github.com/mrclay/minify/blob/3.0.10/composer.json#L37

glensc avatar Jul 12 '20 06:07 glensc

Yes and no; it was already reported over a year ago but got not response. As minify uses jsmin-php and as both are by the same original author and as there is more activity here, I hoped reporting in miniy would result in someone seeing it. That, at least, has been accomplished. Would appreciate your help! :-)

futtta avatar Jul 12 '20 07:07 futtta

I don't think neither of them is active. but I can accept your pull request, or pull request to add support for some other minifier library :P

and you should cross-link that other PR here and included your secret agenda in issue details that you found no luck there.

glensc avatar Jul 12 '20 07:07 glensc