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

Having a constructor with empty arguments in the last line will cause concatenation problems. #21

Open
flixx opened this issue Dec 21, 2016 · 1 comment

Comments

@flixx
Copy link

flixx commented Dec 21, 2016

UglifyJS also strips the parenthesis of an constructor with empty arguments.

Chrome cannot parse the minified file if:

  • there is a constructor with empty arguments is the last command in a js file and
  • the next file to concatenate starts with a (

example1.js:

// A lot of code...
var foo = new Foo(); // last line

example2.js

(function() { // first line
// A lot code...

example1.min.js' (by UglifyJS)

var e=new Foo

example2.min.js (by UglifyJS)

(function(){

example1.min.js and example2.min.js concatinated

var e=new Foo

(function(){

or (formated by chrome)

var e=new Foo(function(){

which is problematic.

natevw added a commit to natevw/yuglify that referenced this issue Oct 17, 2017
…ad of a custom regex one. this should fix a number of open issues (probably yui#19 and yui#20; not sure about yui#21)
@natevw
Copy link
Contributor

natevw commented Oct 17, 2017

Is this an issue with yuglify, or with UglifyJS? You might get better advice if you ask about this at https://github.com/mishoo/UglifyJS2. Except for some comments handling in the currently published version, yuglify is just a wrapper around UglifyJS2.

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

No branches or pull requests

2 participants