Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Aug 15, 2020
1 parent ad6b54d commit 83d0136
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/function/samples/simplified-nested-if/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
export let foo = 0;

if (unknown)
for (var x = 1; x--; x > 0)
if (!unknown) console.log('effect');
for (var x = 1; x-- > 0; )
if (!unknown) foo++;
else 'Side effect free code to be dropped';
else throw new Error("Shouldn't be reached");

if (unknown)
for (var x = 1; x--; x > 0)
if ((console.log(), false)) console.log('effect');
for (var x = 1; x-- > 0; )
if (foo++, false) foo++;
else 'Side effect free code to be dropped';
else throw new Error("Shouldn't be reached");

if (unknown) {
for (var x = 1; x--; x > 0)
if (!unknown) console.log('effect');
for (var x = 1; x-- > 0; )
if (!unknown) foo++;
else 'Side effect free code to be dropped';
} else throw new Error("Shouldn't be reached");

if (unknown)
for (var x = 1; x--; x > 0)
if (!unknown) console.log('effect');
for (var x = 1; x-- > 0; )
if (!unknown) foo++;
else 'Side effect free code to be dropped';

0 comments on commit 83d0136

Please sign in to comment.