fix delete related issues in collapse_vars and reduce_vars (#1689)
This commit is contained in:
@@ -1544,3 +1544,30 @@ issue_1670_6: {
|
||||
}
|
||||
expect_stdout: "1"
|
||||
}
|
||||
|
||||
unary_delete: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var b = 10;
|
||||
function f() {
|
||||
var a;
|
||||
if (delete a) b--;
|
||||
}
|
||||
f();
|
||||
console.log(b);
|
||||
}
|
||||
expect: {
|
||||
var b = 10;
|
||||
function f() {
|
||||
var a;
|
||||
if (delete a) b--;
|
||||
}
|
||||
f();
|
||||
console.log(b);
|
||||
}
|
||||
expect_stdout: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user