disable reminify()

fix-up for #2708
This commit is contained in:
alexlamsl
2018-01-07 20:56:36 +08:00
parent 7a8eff62ca
commit 4b1799ecdd
5 changed files with 15 additions and 4 deletions

View File

@@ -3206,6 +3206,10 @@ merge(Compressor.prototype, {
if (!(node_def.id in in_use_ids)) {
in_use_ids[node_def.id] = true;
in_use.push(node_def);
if (node_def = node_def.redefined()) {
in_use_ids[node_def.id] = true;
in_use.push(node_def);
}
}
return true;
}

View File

@@ -1237,6 +1237,7 @@ var_catch_toplevel: {
options = {
conditionals: true,
negate_iife: true,
passes: 2,
reduce_funcs: true,
reduce_vars: true,
side_effects: true,

View File

@@ -1516,7 +1516,8 @@ issue_2647_2: {
}
expect: {
(function() {
console.log("pass".toUpperCase());
console.log((() => (x = "pass", x.toUpperCase()))());
var x;
})();
}
expect_stdout: "PASS"

View File

@@ -5632,6 +5632,8 @@ defun_catch_1: {
}
}
expect: {
// TODO: drop unused AST_Defun
function a() {}
try {
throw 42;
} catch (a) {
@@ -5657,6 +5659,8 @@ defun_catch_2: {
}
expect: {
try {
// TODO: drop unused AST_Defun
function a() {}
throw 42;
} catch (a) {
console.log(a);
@@ -5682,6 +5686,8 @@ defun_catch_3: {
expect: {
try {
throw 42;
// TODO: drop unused AST_Defun
function a() {}
} catch (a) {
console.log(a);
}
@@ -5759,6 +5765,8 @@ defun_catch_6: {
} catch (a) {
console.log(a);
}
// TODO: drop unused AST_Defun
function a() {}
}
expect_stdout: "42"
}

View File

@@ -208,9 +208,6 @@ function run_compress_tests() {
});
return false;
}
if (!reminify(test.options, input_code, input_formatted, test.expect_stdout)) {
return false;
}
}
return true;
}