Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jlongster
on Oct 22, 2013
|
parent
|
context
|
favorite
| on:
Let’s get serious about ES6 generator functions
Very cool. I'm glad you went the whole way and transformed everything, including try/catch. I'm assuming it handles exceptions properly in the dynamic context? Take the following code:
try { foo(); yield i; } catch(e) { console.log(e); }
If `foo` throws an exception, I handle it, right? I don't see your generator wrapped in an exception handler, but maybe `wrapGenerator` does it.
bnjmn
on Oct 22, 2013
[–]
Exactly, the `wrapGenerator` function provides a small runtime that (among other things) handles uncaught exceptions:
https://github.com/facebook/regenerator/blob/master/runtime/...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: