fix corner case in hoist_props (#3412)

fixes #3411
This commit is contained in:
Alex Lam S.L
2019-05-14 19:12:00 +08:00
committed by GitHub
parent d538a73250
commit f87caac9d8
2 changed files with 35 additions and 1 deletions

View File

@@ -862,3 +862,27 @@ issue_3071_3: {
}
expect_stdout: "2"
}
issue_3411: {
options = {
hoist_props: true,
reduce_vars: true,
}
input: {
var c = 1;
!function f() {
var o = {
p: --c && f()
};
+o || console.log("PASS");
}();
}
expect: {
var c = 1;
!function f() {
var o_p = --c && f();
+{} || console.log("PASS");
}();
}
expect_stdout: "PASS"
}