fix corner case in mangle (#4966)

fixes #4965
This commit is contained in:
Alex Lam S.L
2021-05-25 23:21:52 +01:00
committed by GitHub
parent eff45eac0e
commit 7caab39e26
3 changed files with 94 additions and 20 deletions

View File

@@ -1341,3 +1341,16 @@ To allow for better optimizations, the compiler makes various assumptions:
// Actual: "FAIL"
```
UglifyJS may modify the input which in turn may suppress those errors.
- Earlier versions of JavaScript will throw `TypeError` with the following:
```javascript
(function() {
{
const a = "foo";
}
{
const a = "bar";
}
})();
// TypeError: const 'a' has already been declared
```
UglifyJS may modify the input which in turn may suppress those errors.