jashkenas/coffee-script — Issue #2126: Missing return statement?
Author: mschwartz
Created: 2012-02-19 18:18:27+00:00
State: open

I write a one line coffeescript:
```
"foo"
```

It compiles to
```
"foo";
```

I think it should compile to:
```
return "foo";
```

What it currently compiles to is worthless. Adding a return statement:
```
return "foo"
```

WebStorm complains it is a syntax error. It probably is, the way CoffeeScript handles this situation. There's an implied function, (function() { "foo"; }), right? So it should generate the return statement.

Use case:
https://gist.github.com/1864870

That would be using CoffeeScript as a page template.