fix corner case in awaits & side_effects (#5072)

fixes #5070
This commit is contained in:
Alex Lam S.L
2021-07-11 06:43:08 +01:00
committed by GitHub
parent 08391b8e1c
commit 64ebf6efe9
2 changed files with 24 additions and 0 deletions

View File

@@ -7820,6 +7820,7 @@ merge(Compressor.prototype, {
if (abort) return true;
if (tw.parent() === exp && node.may_throw(compressor)) return abort = true;
if (node instanceof AST_Await) return abort = true;
if (node instanceof AST_ForAwaitOf) return abort = true;
if (node instanceof AST_Return) {
if (node.value && !is_primitive(compressor, node.value)) return abort = true;
return;