fix corner case in collapse_vars (#4634)

fixes #4633
This commit is contained in:
Alex Lam S.L
2021-02-10 00:45:36 +00:00
committed by GitHub
parent 228cdf8e7e
commit 5e6307974f
2 changed files with 31 additions and 1 deletions

View File

@@ -644,3 +644,33 @@ issue_4623: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4633: {
options = {
collapse_vars: true,
unused: true,
}
input: {
var a = function*() {
(function(log) {
log(typeof this);
})(yield "PASS");
}();
console.log(a.next().value);
a.next(console.log);
}
expect: {
var a = function*() {
(function(log) {
log(typeof this);
})(yield "PASS");
}();
console.log(a.next().value);
a.next(console.log);
}
expect_stdout: [
"PASS",
"object",
]
node_version: ">=4"
}