workaround various IE quirks (#5084)

fixes #5081
This commit is contained in:
Alex Lam S.L
2021-07-17 13:20:56 +01:00
committed by GitHub
parent 902997b73d
commit ef5f7fc25e
33 changed files with 477 additions and 311 deletions

View File

@@ -10,7 +10,7 @@ jobs:
matrix:
options:
- '-mb braces'
- '--ie8 -c'
- '--ie -c'
- '-mc'
- '-p acorn --toplevel -mco spidermonkey'
- '--toplevel -mc passes=3,pure_getters,unsafe'

View File

@@ -111,8 +111,8 @@ a double dash to prevent input files being used as option arguments:
-d, --define <expr>[=value] Global definitions.
-e, --enclose [arg[:value]] Embed everything in a big function, with configurable
argument(s) & value(s).
--ie8 Support non-standard Internet Explorer 8.
Equivalent to setting `ie8: true` in `minify()`
--ie Support non-standard Internet Explorer.
Equivalent to setting `ie: true` in `minify()`
for `compress`, `mangle` and `output` options.
By default UglifyJS will not try to be IE-proof.
--keep-fnames Do not mangle/drop function names. Useful for
@@ -502,7 +502,7 @@ if (result.error) throw result.error;
- `compress` (default: `{}`) — pass `false` to skip compressing entirely.
Pass an object to specify custom [compress options](#compress-options).
- `ie8` (default: `false`) — set to `true` to support IE8.
- `ie` (default: `false`) — enable workarounds for Internet Explorer bugs.
- `keep_fnames` (default: `false`) — pass `true` to prevent discarding or mangling
of function names. Useful for code relying on `Function.prototype.name`.
@@ -566,7 +566,6 @@ if (result.error) throw result.error;
},
nameCache: null, // or specify a name cache object
toplevel: false,
ie8: false,
warnings: false,
}
```
@@ -795,9 +794,8 @@ to be `false` and all symbol names will be omitted.
variables (`"vars"`) in the top level scope (`false` by default, `true` to drop
both unreferenced functions and variables)
- `typeofs` (default: `true`) — Transforms `typeof foo == "undefined"` into
`foo === void 0`. Note: recommend to set this value to `false` for IE10 and
earlier versions due to known issues.
- `typeofs` (default: `true`) — compress `typeof` expressions, e.g.
`typeof foo == "undefined" → void 0 === foo`
- `unsafe` (default: `false`) — apply "unsafe" transformations (discussion below)

View File

@@ -101,7 +101,7 @@ function process_option(name, no_value) {
" --config-file <file> Read minify() options from JSON file.",
" -d, --define <expr>[=value] Global definitions.",
" -e, --enclose [arg[,...][:value[,...]]] Embed everything in a big function, with configurable argument(s) & value(s).",
" --ie8 Support non-standard Internet Explorer 8.",
" --ie Support non-standard Internet Explorer.",
" --keep-fnames Do not mangle/drop function names. Useful for code relying on Function.prototype.name.",
" --name-cache <file> File to hold mangled name mappings.",
" --rename Force symbol expansion.",
@@ -110,6 +110,7 @@ function process_option(name, no_value) {
" --source-map [options] Enable source map/specify source map options.",
" --timings Display operations run time on STDERR.",
" --toplevel Compress and/or mangle variables in toplevel scope.",
" --v8 Support non-standard Chrome & Node.js.",
" --validate Perform validation during AST manipulations.",
" --verbose Print diagnostic messages.",
" --warn Print warning messages.",
@@ -145,9 +146,11 @@ function process_option(name, no_value) {
options[name] = read_value();
break;
case "annotations":
case "ie":
case "ie8":
case "timings":
case "toplevel":
case "v8":
case "validate":
case "webkit":
options[name] = true;

View File

@@ -70,7 +70,7 @@ function Compressor(options, false_by_default) {
hoist_funs : false,
hoist_props : !false_by_default,
hoist_vars : false,
ie8 : false,
ie : false,
if_return : !false_by_default,
imports : !false_by_default,
inline : !false_by_default,
@@ -206,7 +206,7 @@ merge(Compressor.prototype, {
var passes = +this.options.passes || 1;
var min_count = 1 / 0;
var stopping = false;
var mangle = { ie8: this.option("ie8") };
var mangle = { ie: this.option("ie") };
for (var pass = 0; pass < passes; pass++) {
node.figure_out_scope(mangle);
if (pass > 0 || this.option("reduce_vars"))
@@ -513,7 +513,7 @@ merge(Compressor.prototype, {
if (scope.uses_arguments) scope.each_argname(function(node) {
node.definition().last_ref = false;
});
if (compressor.option("ie8")) scope.variables.each(function(def) {
if (compressor.option("ie")) scope.variables.each(function(def) {
var d = def.orig[0].definition();
if (d !== def) d.fixed = false;
});
@@ -2249,7 +2249,7 @@ merge(Compressor.prototype, {
return side_effects || lhs instanceof AST_PropAccess || may_modify(lhs);
}
if (node instanceof AST_Function) {
return compressor.option("ie8") && node.name && lvalues.has(node.name.name);
return compressor.option("ie") && node.name && lvalues.has(node.name.name);
}
if (node instanceof AST_ObjectIdentity) return symbol_in_lvalues(node, parent);
if (node instanceof AST_PropAccess) {
@@ -4208,7 +4208,7 @@ merge(Compressor.prototype, {
AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) {
if (!compressor.option("global_defs")) return this;
this.figure_out_scope({ ie8: compressor.option("ie8") });
this.figure_out_scope({ ie: compressor.option("ie") });
return this.transform(new TreeTransformer(function(node) {
var def = node._find_defs(compressor, "");
if (!def) return;
@@ -5672,7 +5672,7 @@ merge(Compressor.prototype, {
if (node instanceof AST_Call) {
var exp = node.expression;
var tail = exp.tail_node();
if (!(tail instanceof AST_LambdaExpression)) return;
if (!(tail instanceof AST_LambdaExpression)) return walk_node_with_expr(node);
if (exp !== tail) exp.expressions.slice(0, -1).forEach(function(node) {
node.walk(tw);
});
@@ -5788,6 +5788,7 @@ merge(Compressor.prototype, {
pop();
return true;
}
if (node instanceof AST_Sub) return walk_node_with_expr(node);
if (node instanceof AST_Switch) {
node.expression.walk(tw);
var save = segment;
@@ -5886,6 +5887,15 @@ merge(Compressor.prototype, {
pop();
return true;
}
function walk_node_with_expr(node) {
descend();
if (compressor.option("ie")) {
var sym = root_expr(node.expression);
if (sym instanceof AST_SymbolRef) sym.walk(tw);
}
return true;
}
});
tw.directives = Object.create(compressor.directives);
self.walk(tw);
@@ -6235,7 +6245,7 @@ merge(Compressor.prototype, {
});
tw.directives = Object.create(compressor.directives);
self.walk(tw);
var drop_fn_name = compressor.option("keep_fnames") ? return_false : compressor.option("ie8") ? function(def) {
var drop_fn_name = compressor.option("keep_fnames") ? return_false : compressor.option("ie") ? function(def) {
return !compressor.exposed(def) && def.references.length == def.replaced;
} : function(def) {
if (!(def.id in in_use_ids)) return true;
@@ -6247,7 +6257,7 @@ merge(Compressor.prototype, {
return !ref.in_arg;
});
};
if (compressor.option("ie8")) initializations.each(function(init, id) {
if (compressor.option("ie")) initializations.each(function(init, id) {
if (id in in_use_ids) return;
init.forEach(function(init) {
init.walk(new TreeWalker(function(node) {
@@ -6535,7 +6545,7 @@ merge(Compressor.prototype, {
head.push(def);
}
} else if (compressor.option("functions")
&& !compressor.option("ie8")
&& !compressor.option("ie")
&& drop_sym
&& var_defs[sym.id] == 1
&& sym.assignments == 0
@@ -7652,7 +7662,7 @@ merge(Compressor.prototype, {
});
function fn_name_unused(fn, compressor) {
if (!fn.name || !compressor.option("ie8")) return true;
if (!fn.name || !compressor.option("ie")) return true;
var def = fn.name.definition();
if (compressor.exposed(def)) return false;
return all(def.references, function(sym) {
@@ -7969,7 +7979,7 @@ merge(Compressor.prototype, {
var alternative = this.alternative.drop_side_effect_free(compressor);
if (consequent === this.consequent && alternative === this.alternative) return this;
var exprs;
if (compressor.option("ie8")) {
if (compressor.option("ie")) {
exprs = [];
if (consequent instanceof AST_Function) {
exprs.push(consequent);
@@ -7998,7 +8008,7 @@ merge(Compressor.prototype, {
node.consequent = consequent;
node.alternative = alternative;
}
if (!compressor.option("ie8")) return node;
if (!compressor.option("ie")) return node;
if (node) exprs.push(node);
return exprs.length == 0 ? null : make_sequence(this, exprs);
});
@@ -9411,7 +9421,7 @@ merge(Compressor.prototype, {
return arg.value;
}).join() + "){" + self.args[self.args.length - 1].value + "})";
var ast = parse(code);
var mangle = { ie8: compressor.option("ie8") };
var mangle = { ie: compressor.option("ie") };
ast.figure_out_scope(mangle);
var comp = new Compressor(compressor.options);
ast = ast.transform(comp);
@@ -10465,7 +10475,7 @@ merge(Compressor.prototype, {
&& self.right.operator == "typeof") {
var expr = self.right.expression;
if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor)
: !(expr instanceof AST_PropAccess && compressor.option("ie8"))) {
: !(expr instanceof AST_PropAccess && compressor.option("ie"))) {
self.right = expr;
self.left = make_node(AST_Undefined, self.left).optimize(compressor);
if (self.operator.length == 2) self.operator += "=";
@@ -11079,7 +11089,7 @@ merge(Compressor.prototype, {
}
OPT(AST_SymbolRef, function(self, compressor) {
if (!compressor.option("ie8")
if (!compressor.option("ie")
&& is_undeclared_ref(self)
// testing against `self.scope.uses_with` is an optimization
&& !(self.scope.resolve().uses_with && compressor.find_parent(AST_With))) {
@@ -11121,7 +11131,7 @@ merge(Compressor.prototype, {
single_use = false;
} else if (fixed.has_side_effects(compressor)) {
single_use = false;
} else if (compressor.option("ie8") && fixed instanceof AST_Class) {
} else if (compressor.option("ie") && fixed instanceof AST_Class) {
single_use = false;
}
if (single_use) fixed.parent_scope = self.scope;

View File

@@ -76,6 +76,7 @@ function minify(files, options) {
annotations: undefined,
compress: {},
enclose: false,
ie: false,
ie8: false,
keep_fnames: false,
mangle: {},
@@ -96,7 +97,7 @@ function minify(files, options) {
var timings = options.timings && { start: Date.now() };
if (options.rename === undefined) options.rename = options.compress && options.mangle;
if (options.annotations !== undefined) set_shorthand("annotations", options, [ "compress", "output" ]);
if (options.ie8) set_shorthand("ie8", options, [ "compress", "mangle", "output" ]);
if (options.ie || options.ie8) set_shorthand("ie", options, [ "compress", "mangle", "output" ]);
if (options.keep_fnames) set_shorthand("keep_fnames", options, [ "compress", "mangle" ]);
if (options.toplevel) set_shorthand("toplevel", options, [ "compress", "mangle" ]);
if (options.v8) set_shorthand("v8", options, [ "mangle", "output" ]);
@@ -106,7 +107,7 @@ function minify(files, options) {
options.mangle = defaults(options.mangle, {
cache: options.nameCache && (options.nameCache.vars || {}),
eval: false,
ie8: false,
ie: false,
keep_fnames: false,
properties: false,
reserved: [],

View File

@@ -56,7 +56,7 @@ function OutputStream(options) {
braces : false,
comments : false,
galio : false,
ie8 : false,
ie : false,
indent_level : 4,
indent_start : 0,
inline_script : true,
@@ -193,7 +193,7 @@ function OutputStream(options) {
case "\t": return "\\t";
case "\b": return "\\b";
case "\f": return "\\f";
case "\x0B": return options.ie8 ? "\\x0B" : "\\v";
case "\x0B": return options.ie ? "\\x0B" : "\\v";
case "\u2028": return "\\u2028";
case "\u2029": return "\\u2029";
case "\ufeff": return "\\ufeff";
@@ -1290,7 +1290,7 @@ function OutputStream(options) {
function make_then(self, output) {
var b = self.body;
if (output.option("braces") && !(b instanceof AST_Const || b instanceof AST_Let)
|| output.option("ie8") && b instanceof AST_Do)
|| output.option("ie") && b instanceof AST_Do)
return make_block(b, output);
// The squeezer replaces "block"-s that contain only a single
// statement with the statement itself; technically, the AST
@@ -1515,7 +1515,7 @@ function OutputStream(options) {
var expr = self.expression;
expr.print(output);
var prop = self.property;
if (output.option("ie8") && RESERVED_WORDS[prop]) {
if (output.option("ie") && RESERVED_WORDS[prop]) {
output.print(self.optional ? "?.[" : "[");
output.add_mapping(self.end);
output.print_string(prop);
@@ -1702,7 +1702,7 @@ function OutputStream(options) {
var quote = self.start && self.start.quote;
if (self.private) {
output.print_name(key);
} else if (RESERVED_WORDS[key] ? !output.option("ie8") : is_identifier_string(key)) {
} else if (RESERVED_WORDS[key] ? !output.option("ie") : is_identifier_string(key)) {
if (quote && output.option("keep_quoted_props")) {
output.print_string(key, quote);
} else {

View File

@@ -118,7 +118,7 @@ function is_lhs(node, parent) {
AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
options = defaults(options, {
cache: null,
ie8: false,
ie: false,
});
// pass 1: setup scope chaining and handle definitions
@@ -211,7 +211,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
entangle(defun, scope);
} else if (node instanceof AST_SymbolLambda) {
var def = defun.def_function(node, node.name == "arguments" ? undefined : defun);
if (options.ie8) def.defun = defun.parent_scope.resolve();
if (options.ie) def.defun = defun.parent_scope.resolve();
} else if (node instanceof AST_SymbolLet) {
var def = scope.def_variable(node);
if (exported) def.exported = true;
@@ -351,7 +351,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
self.walk(tw);
// pass 3: fix up any scoping issue with IE8
if (options.ie8) self.walk(new TreeWalker(function(node) {
if (options.ie) self.walk(new TreeWalker(function(node) {
if (node instanceof AST_SymbolCatch) {
var scope = node.thedef.defun;
if (scope.name instanceof AST_SymbolLambda && scope.name.name == node.name) {
@@ -572,7 +572,7 @@ AST_Symbol.DEFMETHOD("definition", function() {
function _default_mangler_options(options) {
options = defaults(options, {
eval : false,
ie8 : false,
ie : false,
keep_fnames : false,
reserved : [],
toplevel : false,

View File

@@ -1157,7 +1157,7 @@ issue_4705: {
issue_4720: {
options = {
ie8: true,
ie: true,
reduce_vars: true,
toplevel: true,
unused: true,
@@ -1629,7 +1629,7 @@ issue_4951_2: {
issue_4962_1: {
options = {
ie8: true,
ie: true,
inline: true,
reduce_vars: true,
unused: true,
@@ -1656,7 +1656,7 @@ issue_4962_1: {
issue_4962_2: {
options = {
ie8: true,
ie: true,
inline: true,
reduce_vars: true,
unused: true,

View File

@@ -6008,7 +6008,7 @@ issue_3215_1: {
options = {
collapse_vars: true,
evaluate: true,
ie8: false,
ie: false,
inline: true,
passes: 2,
side_effects: true,
@@ -6030,7 +6030,7 @@ issue_3215_2: {
options = {
collapse_vars: true,
evaluate: true,
ie8: true,
ie: true,
inline: true,
passes: 2,
side_effects: true,
@@ -6055,7 +6055,7 @@ issue_3215_3: {
options = {
collapse_vars: true,
evaluate: true,
ie8: false,
ie: false,
inline: true,
passes: 2,
side_effects: true,
@@ -6078,7 +6078,7 @@ issue_3215_4: {
options = {
collapse_vars: true,
evaluate: true,
ie8: true,
ie: true,
inline: true,
passes: 2,
side_effects: true,

View File

@@ -486,7 +486,7 @@ do_continue: {
catch_ie8_1: {
options = {
ie8: true,
ie: true,
unused: true,
}
input: {
@@ -506,7 +506,7 @@ catch_ie8_1: {
catch_ie8_2: {
options = {
dead_code: true,
ie8: true,
ie: true,
passes: 2,
toplevel: true,
unused: true,
@@ -727,7 +727,7 @@ issue_4193: {
issue_4195: {
mangle = {
ie8: true,
ie: true,
}
input: {
console.log(function f(a) {
@@ -1131,7 +1131,7 @@ issue_4225: {
issue_4229: {
options = {
ie8: true,
ie: true,
side_effects: true,
}
input: {
@@ -1151,7 +1151,7 @@ issue_4229: {
issue_4231: {
options = {
ie8: true,
ie: true,
side_effects: true,
}
input: {

View File

@@ -1709,7 +1709,7 @@ issue_4588_2_evaluate: {
issue_4817: {
options = {
ie8: true,
ie: true,
inline: true,
unused: true,
}

View File

@@ -2029,7 +2029,7 @@ issue_4321: {
issue_4323: {
options = {
ie8: true,
ie: true,
inline: true,
merge_vars: true,
reduce_vars: true,

View File

@@ -2345,7 +2345,7 @@ function_argument_reference: {
function_parameter_ie8: {
options = {
ie8: true,
ie: true,
reduce_vars: true,
unused: true,
}
@@ -3230,7 +3230,7 @@ issue_4558_1: {
issue_4558_2: {
options = {
evaluate: true,
ie8: true,
ie: true,
reduce_vars: true,
unused: true,
}

View File

@@ -2123,7 +2123,7 @@ issue_3016_2: {
issue_3016_2_ie8: {
options = {
dead_code: true,
ie8: true,
ie: true,
inline: true,
toplevel: true,
}
@@ -2188,7 +2188,7 @@ issue_3016_3: {
issue_3016_3_ie8: {
options = {
dead_code: true,
ie8: true,
ie: true,
inline: true,
toplevel: true,
}

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ typeof_eq_undefined: {
typeof_eq_undefined_ie8: {
options = {
comparisons: true,
ie8: true,
ie: true,
typeofs: true,
}
input: {

View File

@@ -1,9 +1,9 @@
screw_ie8: {
options = {
ie8: false,
ie: false,
}
mangle = {
ie8: false,
ie: false,
}
input: {
try { throw "foo"; } catch (x) { console.log(x); }
@@ -16,10 +16,10 @@ screw_ie8: {
support_ie8: {
options = {
ie8: true,
ie: true,
}
mangle = {
ie8: true,
ie: true,
}
input: {
try { throw "foo"; } catch (x) { console.log(x); }

View File

@@ -1,10 +1,10 @@
mangle_catch: {
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -22,11 +22,11 @@ mangle_catch: {
mangle_catch_ie8: {
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -44,11 +44,11 @@ mangle_catch_ie8: {
mangle_catch_var: {
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -66,11 +66,11 @@ mangle_catch_var: {
mangle_catch_var_ie8: {
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -88,11 +88,11 @@ mangle_catch_var_ie8: {
mangle_catch_toplevel: {
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -110,11 +110,11 @@ mangle_catch_toplevel: {
mangle_catch_ie8_toplevel: {
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -132,11 +132,11 @@ mangle_catch_ie8_toplevel: {
mangle_catch_var_toplevel: {
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -154,11 +154,11 @@ mangle_catch_var_toplevel: {
mangle_catch_var_ie8_toplevel: {
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -176,11 +176,11 @@ mangle_catch_var_ie8_toplevel: {
mangle_catch_redef_1: {
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -198,11 +198,11 @@ mangle_catch_redef_1: {
mangle_catch_redef_1_ie8: {
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -220,11 +220,11 @@ mangle_catch_redef_1_ie8: {
mangle_catch_redef_1_toplevel: {
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -242,11 +242,11 @@ mangle_catch_redef_1_toplevel: {
mangle_catch_redef_1_ie8_toplevel: {
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -264,11 +264,11 @@ mangle_catch_redef_1_ie8_toplevel: {
mangle_catch_redef_2: {
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -285,11 +285,11 @@ mangle_catch_redef_2: {
mangle_catch_redef_2_ie8: {
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -306,11 +306,11 @@ mangle_catch_redef_2_ie8: {
mangle_catch_redef_2_toplevel: {
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -327,11 +327,11 @@ mangle_catch_redef_2_toplevel: {
mangle_catch_redef_2_ie8_toplevel: {
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -348,7 +348,7 @@ mangle_catch_redef_2_ie8_toplevel: {
mangle_catch_redef_3: {
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -371,7 +371,7 @@ mangle_catch_redef_3: {
mangle_catch_redef_3_toplevel: {
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -394,7 +394,7 @@ mangle_catch_redef_3_toplevel: {
mangle_catch_redef_3_ie8: {
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -417,7 +417,7 @@ mangle_catch_redef_3_ie8: {
mangle_catch_redef_3_ie8_toplevel: {
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {

View File

@@ -1,6 +1,6 @@
function_iife_catch: {
mangle = {
ie8: false,
ie: false,
}
input: {
function f(n) {
@@ -21,7 +21,7 @@ function_iife_catch: {
function_iife_catch_ie8: {
mangle = {
ie8: true,
ie: true,
}
input: {
function f(n) {
@@ -42,7 +42,7 @@ function_iife_catch_ie8: {
function_catch_catch: {
mangle = {
ie8: false,
ie: false,
}
input: {
var o = 0;
@@ -70,7 +70,7 @@ function_catch_catch: {
function_catch_catch_ie8: {
mangle = {
ie8: true,
ie: true,
}
input: {
var o = 0;

View File

@@ -951,7 +951,7 @@ function_name_mangle_ie8: {
unused: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {

View File

@@ -1164,7 +1164,7 @@ issue_4225: {
issue_4229: {
options = {
ie8: true,
ie: true,
side_effects: true,
}
input: {
@@ -1195,7 +1195,7 @@ issue_4229: {
issue_4231: {
options = {
ie8: true,
ie: true,
side_effects: true,
}
input: {
@@ -1564,7 +1564,7 @@ issue_4438: {
issue_4531_1: {
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -1590,11 +1590,11 @@ issue_4531_1: {
issue_4531_2: {
options = {
evaluate: true,
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {

View File

@@ -265,7 +265,7 @@ issue_1532_2: {
issue_186: {
beautify = {
beautify: false,
ie8: false,
ie: false,
}
input: {
var x = 3;
@@ -284,7 +284,7 @@ issue_186: {
issue_186_ie8: {
beautify = {
beautify: false,
ie8: true,
ie: true,
}
input: {
var x = 3;
@@ -303,7 +303,7 @@ issue_186_ie8: {
issue_186_beautify: {
beautify = {
beautify: true,
ie8: false,
ie: false,
}
input: {
var x = 3;
@@ -330,7 +330,7 @@ issue_186_beautify: {
issue_186_beautify_ie8: {
beautify = {
beautify: true,
ie8: true,
ie: true,
}
input: {
var x = 3;
@@ -360,7 +360,7 @@ issue_186_braces: {
beautify = {
beautify: false,
braces: true,
ie8: false,
ie: false,
}
input: {
var x = 3;
@@ -380,7 +380,7 @@ issue_186_braces_ie8: {
beautify = {
beautify: false,
braces: true,
ie8: true,
ie: true,
}
input: {
var x = 3;
@@ -400,7 +400,7 @@ issue_186_beautify_braces: {
beautify = {
beautify: true,
braces: true,
ie8: false,
ie: false,
}
input: {
var x = 3;
@@ -432,7 +432,7 @@ issue_186_beautify_braces_ie8: {
beautify = {
beautify: true,
braces: true,
ie8: true,
ie: true,
}
input: {
var x = 3;

View File

@@ -359,7 +359,7 @@ issue_4107: {
issue_4109: {
options = {
ie8: true,
ie: true,
merge_vars: true,
toplevel: true,
}

View File

@@ -265,7 +265,7 @@ de_morgan_2e: {
issue_4679: {
options = {
comparisons: true,
ie8: true,
ie: true,
}
input: {
var a;

View File

@@ -256,7 +256,7 @@ issue_4906: {
issue_4928: {
options = {
ie8: true,
ie: true,
toplevel: true,
unused: true,
}
@@ -308,7 +308,7 @@ issue_4947_2: {
issue_5039: {
options = {
ie8: true,
ie: true,
side_effects: true,
toplevel: true,
unused: true,

View File

@@ -17,7 +17,7 @@ dot_properties: {
properties: true,
}
beautify = {
ie8: true,
ie: true,
}
input: {
a["foo"] = "bar";
@@ -43,7 +43,7 @@ dot_properties_es5: {
properties: true,
}
beautify = {
ie8: false,
ie: false,
}
input: {
a["foo"] = "bar";

View File

@@ -1,11 +1,11 @@
mangle_catch: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -24,11 +24,11 @@ mangle_catch: {
mangle_catch_ie8: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -47,11 +47,11 @@ mangle_catch_ie8: {
mangle_catch_var: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -70,11 +70,11 @@ mangle_catch_var: {
mangle_catch_var_ie8: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -93,11 +93,11 @@ mangle_catch_var_ie8: {
mangle_catch_toplevel: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -116,11 +116,11 @@ mangle_catch_toplevel: {
mangle_catch_ie8_toplevel: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -139,11 +139,11 @@ mangle_catch_ie8_toplevel: {
mangle_catch_var_toplevel: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -162,11 +162,11 @@ mangle_catch_var_toplevel: {
mangle_catch_var_ie8_toplevel: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -185,11 +185,11 @@ mangle_catch_var_ie8_toplevel: {
mangle_catch_redef_1: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -208,11 +208,11 @@ mangle_catch_redef_1: {
mangle_catch_redef_1_ie8: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -231,11 +231,11 @@ mangle_catch_redef_1_ie8: {
mangle_catch_redef_1_toplevel: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -254,11 +254,11 @@ mangle_catch_redef_1_toplevel: {
mangle_catch_redef_1_ie8_toplevel: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -277,11 +277,11 @@ mangle_catch_redef_1_ie8_toplevel: {
mangle_catch_redef_2: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: false,
}
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -299,11 +299,11 @@ mangle_catch_redef_2: {
mangle_catch_redef_2_ie8: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: false,
}
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -321,11 +321,11 @@ mangle_catch_redef_2_ie8: {
mangle_catch_redef_2_toplevel: {
rename = true
options = {
ie8: false,
ie: false,
toplevel: true,
}
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -343,11 +343,11 @@ mangle_catch_redef_2_toplevel: {
mangle_catch_redef_2_ie8_toplevel: {
rename = true
options = {
ie8: true,
ie: true,
toplevel: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -365,7 +365,7 @@ mangle_catch_redef_2_ie8_toplevel: {
issue_2120_1: {
rename = true
mangle = {
ie8: false,
ie: false,
}
input: {
"aaaaaaaa";
@@ -401,7 +401,7 @@ issue_2120_1: {
issue_2120_2: {
rename = true
mangle = {
ie8: true,
ie: true,
}
input: {
"aaaaaaaa";
@@ -436,7 +436,7 @@ issue_2120_2: {
function_iife_catch: {
rename = true
mangle = {
ie8: false,
ie: false,
}
input: {
function f(n) {
@@ -458,7 +458,7 @@ function_iife_catch: {
function_iife_catch_ie8: {
rename = true
mangle = {
ie8: true,
ie: true,
}
input: {
function f(n) {
@@ -480,7 +480,7 @@ function_iife_catch_ie8: {
function_catch_catch: {
rename = true
mangle = {
ie8: false,
ie: false,
}
input: {
var o = 0;
@@ -509,7 +509,7 @@ function_catch_catch: {
function_catch_catch_ie8: {
rename = true
mangle = {
ie8: true,
ie: true,
}
input: {
var o = 0;
@@ -538,12 +538,12 @@ function_catch_catch_ie8: {
function_do_catch_ie8: {
rename = true
options = {
ie8: true,
ie: true,
side_effects: true,
unused: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -615,7 +615,7 @@ function_do_catch_ie8: {
issue_3480: {
rename = true,
mangle = {
ie8: false,
ie: false,
toplevel: false,
}
input: {
@@ -647,7 +647,7 @@ issue_3480: {
issue_3480_ie8: {
rename = true,
mangle = {
ie8: true,
ie: true,
toplevel: false,
}
input: {
@@ -679,7 +679,7 @@ issue_3480_ie8: {
issue_3480_toplevel: {
rename = true,
mangle = {
ie8: false,
ie: false,
toplevel: true,
}
input: {
@@ -711,7 +711,7 @@ issue_3480_toplevel: {
issue_3480_ie8_toplevel: {
rename = true,
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {

View File

@@ -833,7 +833,7 @@ issue_4562: {
issue_4575: {
options = {
collapse_vars: true,
ie8: true,
ie: true,
reduce_vars: true,
rests: true,
unused: true,

View File

@@ -61,7 +61,7 @@ lambda_name_mangle: {
lambda_name_mangle_ie8: {
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {
@@ -95,7 +95,7 @@ function_name_mangle_ie8: {
unused: true,
}
mangle = {
ie8: true,
ie: true,
toplevel: true,
}
input: {

View File

@@ -1,21 +0,0 @@
var assert = require("assert");
var UglifyJS = require("../..");
describe("ie8", function() {
it("Should be able to minify() with undefined as catch parameter in a try...catch statement", function() {
assert.strictEqual(
UglifyJS.minify([
"function a(b){",
" try {",
" throw 'Stuff';",
" } catch (undefined) {",
" console.log('caught: ' + undefined);",
" }",
" console.log('undefined is ' + undefined);",
" return b === undefined;",
"};",
].join("\n")).code,
'function a(o){try{throw"Stuff"}catch(o){console.log("caught: "+o)}return console.log("undefined is "+void 0),void 0===o}'
);
});
});

View File

@@ -41,7 +41,7 @@ describe("let", function() {
}
var result = UglifyJS.minify(s, {
compress: false,
ie8: true,
ie: true,
mangle: {
properties: true,
}

View File

@@ -22,7 +22,7 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
reduce_options = reduce_options || {};
var print_options = {};
[
"ie8",
"ie",
"v8",
"webkit",
].forEach(function(name) {

View File

@@ -16,7 +16,7 @@
},
{},
{
"ie8": true,
"ie": true,
"toplevel": true
},
{