Fix warnings for referenced non-hoisted functions.
Fixes #1034 Also added `expect_warnings` functionality to test framework.
This commit is contained in:
@@ -801,7 +801,9 @@ merge(Compressor.prototype, {
|
||||
};
|
||||
|
||||
function extract_declarations_from_unreachable_code(compressor, stat, target) {
|
||||
compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||
if (!(stat instanceof AST_Defun)) {
|
||||
compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||
}
|
||||
stat.walk(new TreeWalker(function(node){
|
||||
if (node instanceof AST_Definitions) {
|
||||
compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start);
|
||||
|
||||
Reference in New Issue
Block a user