If v8 implements this, both Firefox and Chrome as well as node.js will have yield, enabling libraries like taskjs [1] to be used.
From taskjs.org:
spawn(function*() {
var data = yield $.ajax(url);
$('#result').html(data);
var status = $('#status').html('Download complete.');
yield status.fadeIn().promise();
yield sleep(2000);
status.fadeOut();
});
Does anyone here have experience with using one of those X-to-JS compilers that do a similar thing but without requiring those Javascript extensions? The only one I hear people talking about a lot is icedcofeescript but I'm not a big cofeescript fan...
Comments
If you want this problem solved, vote on the generators issue in v8:
http://code.google.com/p/v8/issues/detail?id=2355
If v8 implements this, both Firefox and Chrome as well as node.js will have yield, enabling libraries like taskjs [1] to be used.
From taskjs.org:
[1]: http://taskjs.org/Does anyone here have experience with using one of those X-to-JS compilers that do a similar thing but without requiring those Javascript extensions? The only one I hear people talking about a lot is icedcofeescript but I'm not a big cofeescript fan...