rainforestapp / decaf

Coffeescript to ES.next transpiler. Now maintained over at
https://github.com/juliankrispel/decaf
MIT License
106 stars 10 forks source link

Don't silently drop assignments from for loops with guards #156

Closed GoodForOneFare closed 8 years ago

GoodForOneFare commented 8 years ago

Takes Coffee like:

results = (item.name for item in items when item == expected)

And turns it into

results = items.filter(item => item === expected).map(item => return item.name);

Suppresses the map call if no transform is necessary.