fix typeof side effects (#1696)
`statement_to_expression()` drops `typeof` even if it operates on undeclared variables. Since we now have `drop_side_effect_free()`, replace and remove this deprecated functionality.
This commit is contained in:
@@ -579,3 +579,17 @@ issue_1690_2: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
if_switch_typeof: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
dead_code: true,
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
if (a) switch(typeof b) {}
|
||||
}
|
||||
expect: {
|
||||
a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user