retain @__PURE__ call when return value is used (#3874)

This commit is contained in:
Alex Lam S.L
2020-05-10 18:07:05 +01:00
committed by GitHub
parent 63adfb1590
commit 7e0ad232b0
2 changed files with 26 additions and 0 deletions

View File

@@ -782,3 +782,28 @@ inline_pure_call_3: {
"undefined",
]
}
inline_pure_call_4: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = /*@__PURE__*/ function() {
return console.log("PASS"), 42;
}();
console.log(a);
}
expect: {
var a = function() {
return console.log("PASS"), 42;
}();
console.log(a);
}
expect_stdout: [
"PASS",
"42",
]
}