14
README.md
14
README.md
@@ -1407,3 +1407,17 @@ To allow for better optimizations, the compiler makes various assumptions:
|
|||||||
// Actual: SyntaxError: Unexpected reserved word
|
// Actual: SyntaxError: Unexpected reserved word
|
||||||
```
|
```
|
||||||
UglifyJS may modify the input which in turn may suppress those errors.
|
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.
|
||||||
|
|||||||
@@ -1559,7 +1559,10 @@ Compressor.prototype.compress = function(node) {
|
|||||||
|
|
||||||
AST_SymbolRef.DEFMETHOD("is_immutable", function() {
|
AST_SymbolRef.DEFMETHOD("is_immutable", function() {
|
||||||
var def = this.redef || this.definition();
|
var def = this.redef || this.definition();
|
||||||
return (this.in_arg || def.orig.length == 1) && def.orig[0] instanceof AST_SymbolLambda;
|
if (!(def.orig[0] instanceof AST_SymbolLambda)) return false;
|
||||||
|
if (def.orig.length == 1) return true;
|
||||||
|
if (!this.in_arg) return false;
|
||||||
|
return !(def.orig[1] instanceof AST_SymbolFunarg);
|
||||||
});
|
});
|
||||||
|
|
||||||
AST_Node.DEFMETHOD("convert_symbol", noop);
|
AST_Node.DEFMETHOD("convert_symbol", noop);
|
||||||
|
|||||||
@@ -2448,3 +2448,17 @@ issue_5465: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5485: {
|
||||||
|
options = {
|
||||||
|
comparisons: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function f(f, a = console.log(void 0 === f ? "PASS" : "FAIL")) {})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function f(f, a = console.log(void 0 === f ? "PASS" : "FAIL")) {})();
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
@@ -3626,3 +3626,23 @@ issue_5454: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5485: {
|
||||||
|
options = {
|
||||||
|
comparisons: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function f({
|
||||||
|
p: f,
|
||||||
|
[console.log(void 0 === f ? "PASS" : "FAIL")]: a,
|
||||||
|
}) {})(42);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function f({
|
||||||
|
p: f,
|
||||||
|
[console.log(void 0 === f ? "PASS" : "FAIL")]: a,
|
||||||
|
}) {})(42);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user