@@ -3942,6 +3942,7 @@ merge(Compressor.prototype, {
|
|||||||
expressions.unshift(value || make_node(AST_Undefined, self));
|
expressions.unshift(value || make_node(AST_Undefined, self));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
scope.var_names()[name.name] = true;
|
||||||
decls.unshift(make_node(AST_VarDef, name, {
|
decls.unshift(make_node(AST_VarDef, name, {
|
||||||
name: name,
|
name: name,
|
||||||
value: null
|
value: null
|
||||||
|
|||||||
@@ -772,3 +772,78 @@ issue_2476: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "465"
|
expect_stdout: "465"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_2601_1: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
sequences: true,
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "FAIL";
|
||||||
|
(function() {
|
||||||
|
function f(b) {
|
||||||
|
function g(b) {
|
||||||
|
b && b();
|
||||||
|
}
|
||||||
|
g();
|
||||||
|
(function() {
|
||||||
|
b && (a = "PASS");
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
f("foo");
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "FAIL";
|
||||||
|
(function() {
|
||||||
|
b = "foo",
|
||||||
|
function(b) {
|
||||||
|
b && b();
|
||||||
|
}(),
|
||||||
|
b && (a = "PASS");
|
||||||
|
var b;
|
||||||
|
})(),
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_2601_2: {
|
||||||
|
rename = true
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
inline: true,
|
||||||
|
passes: 3,
|
||||||
|
reduce_vars: true,
|
||||||
|
sequences: true,
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
mangle = {}
|
||||||
|
input: {
|
||||||
|
var a = "FAIL";
|
||||||
|
(function() {
|
||||||
|
function f(b) {
|
||||||
|
function g(b) {
|
||||||
|
b && b();
|
||||||
|
}
|
||||||
|
g();
|
||||||
|
(function() {
|
||||||
|
b && (a = "PASS");
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
f("foo");
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "FAIL";
|
||||||
|
a = "PASS",
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user