Skip to content

Commit 71bf6f5

Browse files
committedDec 16, 2015
Merge branch 'master' of https://github.com/vibornoff/grunt-contrib-uglify into fix-screw-ie8-option-crash
2 parents be7de43 + 12c7ded commit 71bf6f5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed
 

‎tasks/lib/uglify.js

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ exports.init = function(grunt) {
8888
if (options.compress.warnings !== true) {
8989
options.compress.warnings = false;
9090
}
91+
if (options.screwIE8) {
92+
options.compress.screw_ie8 = true;
93+
}
9194
var compressor = UglifyJS.Compressor(options.compress);
9295
topLevel = topLevel.transform(compressor);
9396

@@ -134,6 +137,12 @@ exports.init = function(grunt) {
134137
}
135138

136139
if (options.mangle !== false) {
140+
if (options.mangle === true) {
141+
options.mangle = {};
142+
}
143+
if (options.screwIE8) {
144+
options.mangle.screw_ie8 = true;
145+
}
137146
// disabled due to:
138147
// 1) preserve stable name mangling
139148
// 2) it increases gzipped file size, see https://github.com/mishoo/UglifyJS2#mangler-options

‎tasks/uglify.js

-5
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ module.exports = function(grunt) {
128128
options.destToSourceMap = destToSourceMapPath + sourceMapBasename;
129129
}
130130

131-
if (options.screwIE8) {
132-
if (options.mangle) { options.mangle.screw_ie8 = true; }
133-
if (options.compress) { options.compress.screw_ie8 = true; }
134-
}
135-
136131
// Minify files, warn and fail on error.
137132
var result;
138133
try {

0 commit comments

Comments
 (0)
Please sign in to comment.