Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on JavaScript Promises: There and back again. Parent comment
You can inject an exception into a generator via the throw method[0], and it'll be raised at the yield, as if `yield` had thrown[1].
JS exception handling facilities are still crap, though.
[0] http://wiki.ecmascript.org/doku.php?id=harmony:generators#me...
[1] http://wiki.ecmascript.org/doku.php?id=harmony:generators#in...
There are no comments on this comment yet.
You can inject an exception into a generator via the throw method[0], and it'll be raised at the yield, as if `yield` had thrown[1].
JS exception handling facilities are still crap, though.
[0] http://wiki.ecmascript.org/doku.php?id=harmony:generators#me...
[1] http://wiki.ecmascript.org/doku.php?id=harmony:generators#in...