preserve non-constant value assignments with modifications (#2997)

fixes #2995
This commit is contained in:
Alex Lam S.L
2018-03-13 17:35:34 +08:00
committed by GitHub
parent b9f72a4a81
commit 5429234138
2 changed files with 54 additions and 2 deletions

View File

@@ -1785,3 +1785,32 @@ issue_805_2: {
"bar",
]
}
issue_2995: {
options = {
pure_getters: "strict",
reduce_vars: true,
unused: true,
}
input: {
function f(a) {
var b;
a.b = b = function() {};
b.c = "PASS";
}
var o = {};
f(o);
console.log(o.b.c);
}
expect: {
function f(a) {
var b;
a.b = b = function() {};
b.c = "PASS";
}
var o = {};
f(o);
console.log(o.b.c);
}
expect_stdout: "PASS"
}