sweet-js/sweet-core

Missing statement in output

Closed this issue · 2 comments

A funny edge case:

if(true) {
  foo.bar("f")
  x = y
}

The output of this file is:

if (true) {
  x = y;
}

The foo.bar is gone. It seems to only happen with a member lookup. Unfortunately for me, it was a console.log that was missing so it was quite confusing....

Actually, looks like this repros it:

if(true) {
  foo.bar
  x = y
}

Oh, weird, all these edge cases repro:

x
foo.bar
x = y
foo.bar
x = y
x
foo.bar()
x = y
x
foo.bar("hi")
x = y

Fixed in #641