document ECMAScript quirks (#5501)

closes #5500
This commit is contained in:
Alex Lam S.L
2022-06-08 20:01:00 +01:00
committed by GitHub
parent 123f9cf987
commit f749863cb2
2 changed files with 13 additions and 1 deletions

View File

@@ -1429,3 +1429,13 @@ To allow for better optimizations, the compiler makes various assumptions:
// Actual: "undefined 42"
```
UglifyJS may modify the input which in turn may suppress those errors.
- Later versions of JavaScript will throw `SyntaxError` with the following:
```javascript
"use strict";
console.log(function f() {
return f = "PASS";
}());
// Expected: "PASS"
// Actual: TypeError: invalid assignment to const 'f'
```
UglifyJS may modify the input which in turn may suppress those errors.