fix corner case in reduce_vars (#4636)

This commit is contained in:
Alex Lam S.L
2021-02-10 02:37:00 +00:00
committed by GitHub
parent c76481341c
commit 5ec82e5801
2 changed files with 67 additions and 1 deletions

View File

@@ -9836,7 +9836,8 @@ merge(Compressor.prototype, {
}
} while (scope = scope.parent_scope);
}
} else if (fixed.name && fixed.name.name == "await" && is_async(fixed)) {
} else if (fixed.name && (fixed.name.name == "await" && is_async(fixed)
|| fixed.name.name == "yield" && is_generator(fixed))) {
single_use = false;
}
if (single_use) fixed.parent_scope = self.scope;