fix corner case in comparisons (#5486)

fixes #5485
This commit is contained in:
Alex Lam S.L
2022-06-04 17:47:38 +01:00
committed by GitHub
parent ad5f5ef2a3
commit a025392a30
4 changed files with 52 additions and 1 deletions

View File

@@ -1407,3 +1407,17 @@ To allow for better optimizations, the compiler makes various assumptions:
// Actual: SyntaxError: Unexpected reserved word
```
UglifyJS may modify the input which in turn may suppress those errors.
- Later versions of Chrome and Node.js will give incorrect results with the
following:
```javascript
try {
f();
function f() {
throw 42;
}
} catch (e) {}
console.log(typeof f);
// Expected: "function"
// Actual: "undefined"
```
UglifyJS may modify the input which in turn may suppress those errors.