jashkenas/coffee-script — Issue #1940: "statement if evaluation" compiles differently if inside interpolated string
Author: pcg79
Created: 2011-12-16 16:09:37+00:00
State: open

I feel like this is a bug but I could just be doing it wrong.

`"true" if evaluation` compiles to `if (evaluation) "true"`

But wrap that in a string:

`"#{"true" if evaluation}"` compiles to `"" + (evaluation ? 'true' : void 0);`

which of course makes for some unexpected strings when the evaluation is false.