Some browsers, and ES Harmony, have yield. You could add a compiler switch to use native support, although only Firefox seems to support this just now.
Curious to see how you managed the emulation - splitting up a function? Web workers? :)
Curious to see how you managed the emulation - splitting up a function? Web workers? :)