parent
905325d3e2
commit
d66d86f20b
|
|
@ -2758,8 +2758,13 @@ merge(Compressor.prototype, {
|
||||||
return any(this.elements, compressor);
|
return any(this.elements, compressor);
|
||||||
});
|
});
|
||||||
def(AST_Assign, function(compressor){
|
def(AST_Assign, function(compressor){
|
||||||
return this.operator != "=" && this.left.may_throw(compressor)
|
if (this.right.may_throw(compressor)) return true;
|
||||||
|| this.right.may_throw(compressor);
|
if (!compressor.has_directive("use strict")
|
||||||
|
&& this.operator == "="
|
||||||
|
&& this.left instanceof AST_SymbolRef) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.left.may_throw(compressor);
|
||||||
});
|
});
|
||||||
def(AST_Binary, function(compressor){
|
def(AST_Binary, function(compressor){
|
||||||
return this.left.may_throw(compressor)
|
return this.left.may_throw(compressor)
|
||||||
|
|
|
||||||
|
|
@ -4461,3 +4461,59 @@ issue_2878: {
|
||||||
}
|
}
|
||||||
expect_stdout: "1"
|
expect_stdout: "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_2891_1: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "PASS", b;
|
||||||
|
try {
|
||||||
|
b = c.p = 0;
|
||||||
|
a = "FAIL";
|
||||||
|
b();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "PASS", b;
|
||||||
|
try {
|
||||||
|
b = c.p = 0;
|
||||||
|
a = "FAIL";
|
||||||
|
b();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_2891_2: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
"use strict";
|
||||||
|
var a = "PASS", b;
|
||||||
|
try {
|
||||||
|
b = c = 0;
|
||||||
|
a = "FAIL";
|
||||||
|
b();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
"use strict";
|
||||||
|
var a = "PASS", b;
|
||||||
|
try {
|
||||||
|
b = c = 0;
|
||||||
|
a = "FAIL";
|
||||||
|
b();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: true
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user