parent
b309527264
commit
fcc40d0502
|
|
@ -3016,7 +3016,7 @@ merge(Compressor.prototype, {
|
||||||
}
|
}
|
||||||
|
|
||||||
function extract_declarations_from_unreachable_code(compressor, stat, target) {
|
function extract_declarations_from_unreachable_code(compressor, stat, target) {
|
||||||
if (!(stat instanceof AST_Definitions || stat instanceof AST_Defun)) {
|
if (!(stat instanceof AST_Definitions || is_defun(stat))) {
|
||||||
AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||||
}
|
}
|
||||||
var block;
|
var block;
|
||||||
|
|
@ -3032,7 +3032,7 @@ merge(Compressor.prototype, {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (node instanceof AST_Defun) {
|
if (is_defun(node)) {
|
||||||
push(node);
|
push(node);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -471,3 +471,28 @@ issue_4359: {
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=8"
|
node_version: ">=8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4377: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
inline: true,
|
||||||
|
side_effects: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(typeof function() {
|
||||||
|
return function() {
|
||||||
|
f;
|
||||||
|
async function f() {}
|
||||||
|
return f();
|
||||||
|
}();
|
||||||
|
}().then);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(typeof function() {
|
||||||
|
return f();
|
||||||
|
async function f() {}
|
||||||
|
}().then);
|
||||||
|
}
|
||||||
|
expect_stdout: "function"
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user