fix corner case in inline (#3853)

fixes #3852
This commit is contained in:
Alex Lam S.L
2020-05-07 13:53:05 +01:00
committed by GitHub
parent 34ead0430b
commit 88985a46ed
4 changed files with 35 additions and 9 deletions

View File

@@ -2366,7 +2366,7 @@ function_parameter_ie8: {
}
expect: {
(function() {
(function f() {
(function() {
console.log("PASS");
})();
})();

View File

@@ -4660,3 +4660,24 @@ issue_3836: {
}
expect_stdout: "PASS"
}
issue_3852: {
options = {
collapse_vars: true,
inline: true,
unused: true,
}
input: {
console.log(function(a) {
return function(b) {
return b && (b[0] = 0), "PASS";
}(a);
}(42));
}
expect: {
console.log(function(a) {
return a && (a[0] = 0), "PASS";
}(42));
}
expect_stdout: "PASS"
}

View File

@@ -2389,7 +2389,7 @@ issue_3703: {
var a = "PASS";
(function() {
var b;
var c = function g() {
var c = function() {
a = "FAIL";
};
a ? b |= c : b.p;