Skip to content

Commit

Permalink
Merge pull request #377 from avdg/fix-screw-ie8-option-crash
Browse files Browse the repository at this point in the history
Fix screw ie8 option crash
  • Loading branch information
vladikoff committed Feb 2, 2016
2 parents d74556f + 71bf6f5 commit c129bf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions tasks/lib/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ exports.init = function(grunt) {
if (options.compress.warnings !== true) {
options.compress.warnings = false;
}
if (options.screwIE8) {
options.compress.screw_ie8 = true;
}
var compressor = UglifyJS.Compressor(options.compress);
topLevel = topLevel.transform(compressor);

Expand Down Expand Up @@ -140,6 +143,12 @@ exports.init = function(grunt) {
}

if (options.mangle !== false) {
if (options.mangle === true) {
options.mangle = {};
}
if (options.screwIE8) {
options.mangle.screw_ie8 = true;
}
// disabled due to:
// 1) preserve stable name mangling
// 2) it increases gzipped file size, see https://github.com/mishoo/UglifyJS2#mangler-options
Expand Down
5 changes: 0 additions & 5 deletions tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ module.exports = function(grunt) {
options.destToSourceMap = destToSourceMapPath + sourceMapBasename;
}

if (options.screwIE8) {
if (options.mangle) { options.mangle.screw_ie8 = true; }
if (options.compress) { options.compress.screw_ie8 = true; }
}

// Minify files, warn and fail on error.
var result;
try {
Expand Down

0 comments on commit c129bf6

Please sign in to comment.