See #637. This does not produce the optimal result, but it does prevent the removal of non-side-effect-free code.
23 lines
404 B
JavaScript
23 lines
404 B
JavaScript
wrongly_optimized: {
|
|
options = {
|
|
conditionals: true,
|
|
booleans: true,
|
|
evaluate: true
|
|
};
|
|
input: {
|
|
function func() {
|
|
foo();
|
|
}
|
|
if (func() || true) {
|
|
bar();
|
|
}
|
|
}
|
|
expect: {
|
|
function func() {
|
|
foo();
|
|
}
|
|
// TODO: optimize to `func(), bar()`
|
|
(func(), 0) || bar();
|
|
}
|
|
}
|