fix dead_code on block-scoped function under "use strict" (#2006)
Technically not part of ES5, but commonly used code exists in the wild.
This commit is contained in:
@@ -1222,7 +1222,7 @@ merge(Compressor.prototype, {
|
||||
target.push(node);
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_Defun) {
|
||||
if (node instanceof AST_Defun && (node === stat || !compressor.has_directive("use strict"))) {
|
||||
target.push(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user