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

Uglify compressor runs infinitely on particular code when sequences=false #932

Closed
alundeen opened this issue Jan 22, 2016 · 2 comments
Closed

Comments

@alundeen
Copy link

When sequences are turned off with --compress sequences=false, I am unable to uglify this code:

define(["require", "exports"], function (require, exports) {
    var Class = (function () {
        Class.onReady = function (name, callback) {
            if (this.isReady(name)) {
                return callback();
            }
            else {
                (this.callbacks[name] = this.callbacks[name] || []).push(callback);
            }
        };
    })();
});

Example command line, where test.js contains the code above:

# This never completes (it runs for 15+ minutes):
> uglifyjs test.js --mangle --compress sequences=false

# This completes almost instantly
> uglifyjs test.js --mangle --compress

> uglifyjs --version
uglify-js 2.6.0

Similarly, pasting the snippet above into the web demo and unchecking sequences in the compressor options causes Chrome to spike CPU until needing to force-kill the tab.

@mishoo
Copy link
Owner

mishoo commented Jan 22, 2016

It works with the latest code from master. OTOH, the current version on npm is 2.6.1. Please try upgrading, and let me know if it still fails with 2.6.1 so I push out a new version.

@mishoo mishoo closed this as completed Jan 22, 2016
@alundeen
Copy link
Author

Yes, it does work with 2.6.1. uglifyjs was a sub-dependency so I didn't notice the newer version. Sorry for the spam.

Looks like the problem was covered in #866.

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