Converts ES6 yield to ES5 semantics

input (you can edit this). If orange, your code contains a syntax error (ES5!).

output (you can copy this). If orange, compiled code contains a syntax error :)

Tests: pvdz.ee/project/unyield/tests.html

Known wontfixes: finally, catch var stuff, ASI related transformation bugs, multiple yields in the same expression (same statement is fine), any yield inside eval.

This is a nearly complete "clean-room" implementation of translating generators or yield to ES5, allowing you to use generators in current browsers. For more solid, supported solutions see Facebook's Regenerator or Google's Traceur.