fix corner case in unused (#3234)

fixes #3233
This commit is contained in:
Alex Lam S.L
2018-08-23 06:03:39 +08:00
committed by GitHub
parent 57fb58b263
commit 694ca5d045
3 changed files with 36 additions and 14 deletions

View File

@@ -1982,3 +1982,26 @@ issue_3192: {
"foo bar",
]
}
issue_3233: {
options = {
pure_getters: "strict",
side_effects: true,
unused: true,
}
input: {
var a = function b() {
b.c = "PASS";
};
a();
console.log(a.c);
}
expect: {
var a = function b() {
b.c = "PASS";
};
a();
console.log(a.c);
}
expect_stdout: "PASS"
}