terinjokes/gulp-uglify

Uglify mutates code incorrectly

Closed this issue · 2 comments

$rootScope.form = {
    property: value
};

if ($rootScope.form.template.flags !== undefined) {

    if ($rootScope.form.template.flags.includeUsageLog == true) {
        // more stuff
    }

}

Gets mutated to this:

if (e.form = {
    property: value
},
    1 == e.form.template.flags.includeUsageLog) {
    // more stuff
}

The result is that if template doesn't have the flags property, an error is thrown.

This project is a wrapper around UglifyJS. Make sure you're running the latest version of 3.x, and if the issue persists, file a bug with them.