scan assignment value in drop_unused() (#1578)

those were not optimised for `unused` before, which made it necessary for `reduce_vars` to have separate steps for `keep_fnames`

docs update by @kzc

closes #1577
This commit is contained in:
Alex Lam S.L
2017-03-08 18:37:32 +08:00
committed by GitHub
parent 344d11d591
commit 711f88dcb4
3 changed files with 30 additions and 8 deletions

View File

@@ -700,3 +700,28 @@ issue_1539: {
}
}
}
vardef_value: {
options = {
keep_fnames: false,
reduce_vars: true,
unused: true,
}
input: {
function f() {
function g(){
return x();
}
var a = g();
return a(42);
}
}
expect: {
function f() {
var a = function(){
return x();
}();
return a(42);
}
}
}