jashkenas/coffee-script — pull request #3461 by barretron (2014-05-02 08:11:41+00:00)
Title: Auto-generators with `yield`, `yield from`, -g flag, and empty generator support

An attempt to go back to the original intent of #3240, with additional support for `yield from` rather than `yield*`. `-g` command line flag forks Node with a `--harmony-generator` flag. Additionally, per @devongovett 's suggestion, there is support for creation of empty generators with a `yield` statement at the end of a function.

Examples:
```CoffeeScript
fib = ->
[a, b] = [0, 1]
loop
yield a
[a, b] = [b, a + b]

seq = fib()
seq.next() for i in [1..5]
# outputs:
# [ { value: 0, done: false },
# { value: 1, done: false },
# { value: 1, done: false },
# { value: 2, done: false },
# { value: 3, done: false } ]
```
Note: this commit also includes the rough fix for #3395 for the sake of testing (#3450), but fails 3 CoffeeScript tests.

run tests for generators with `node --harmony-generators ./bin/cake test`