fix corner case in collapse_vars (#3954)

This commit is contained in:
Alex Lam S.L
2020-06-05 07:28:08 +01:00
committed by GitHub
parent 04fd3d90f8
commit fbc9d8009b
2 changed files with 31 additions and 7 deletions

View File

@@ -6888,6 +6888,30 @@ sequence_in_iife_2: {
}
expect: {
var a = "foo", b = 42;
b = a;
console.log(a, b);
}
expect_stdout: "foo foo"
}
sequence_in_iife_3: {
options = {
collapse_vars: true,
inline: true,
passes: 2,
side_effects: true,
toplevel: true,
unused: true,
}
input: {
var a = "foo", b = 42;
(function() {
var c = (b = a, b);
})();
console.log(a, b);
}
expect: {
var a = "foo";
console.log(a, a);
}
expect_stdout: "foo foo"