@@ -2560,7 +2560,7 @@ merge(Compressor.prototype, {
|
||||
if (def.undeclared) return;
|
||||
if (is_arguments(def)) return;
|
||||
if (value !== rhs) {
|
||||
if (value.is_immutable()) return;
|
||||
if (is_lhs_read_only(value, compressor)) return;
|
||||
var referenced = def.references.length - def.replaced;
|
||||
if (referenced < 2) return;
|
||||
candidate = candidate.clone();
|
||||
@@ -7330,8 +7330,9 @@ merge(Compressor.prototype, {
|
||||
def(AST_Assign, function(compressor) {
|
||||
var left = this.left;
|
||||
if (left instanceof AST_PropAccess) {
|
||||
if (left.expression.may_throw_on_access(compressor, true)) return this;
|
||||
if (compressor.has_directive("use strict") && left.expression.is_constant()) return this;
|
||||
var expr = left.expression;
|
||||
if (expr.may_throw_on_access(compressor, true)) return this;
|
||||
if (compressor.has_directive("use strict") && expr.is_constant()) return this;
|
||||
}
|
||||
if (left.has_side_effects(compressor)) return this;
|
||||
var right = this.right;
|
||||
|
||||
@@ -8993,3 +8993,20 @@ issue_4852: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_4865: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
}
|
||||
input: {
|
||||
var NaN;
|
||||
var a = NaN = "PASS";
|
||||
console.log(a, NaN);
|
||||
}
|
||||
expect: {
|
||||
var NaN;
|
||||
var a = NaN = "PASS";
|
||||
console.log(a, NaN);
|
||||
}
|
||||
expect_stdout: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user