forbid block-scoped AST_Defun in strict mode (#2718)

This commit is contained in:
Alex Lam S.L
2018-01-04 18:45:51 +08:00
committed by GitHub
parent 7a6d452b54
commit a6873a3859
5 changed files with 79 additions and 187 deletions

View File

@@ -1746,7 +1746,7 @@ merge(Compressor.prototype, {
target.push(node);
return true;
}
if (node instanceof AST_Defun && (node === stat || !compressor.has_directive("use strict"))) {
if (node instanceof AST_Defun) {
target.push(node);
return true;
}