Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle .throw method in delegate generator. Fix #80. #81

Merged
merged 3 commits into from
Feb 2, 2014

Conversation

amasad
Copy link
Contributor

@amasad amasad commented Feb 2, 2014

Make sure the outer generator won't dispatch the same exception handled by delegate generator (initiated by .throw)

@@ -74,6 +74,9 @@
if (delegate) {
try {
var info = delegate.generator[method](arg);
// Delegate generator ran and handled it's own exceptions so
// regardless of what the method is we continue as if it is "next".
method = "next";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to set arg = void 0 here too? Or is the exception that was supposed to be thrown still of any interest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think we can do away with it. will update.

benjamn added a commit that referenced this pull request Feb 2, 2014
Handle .throw method in delegate generator.

Fixes #80.
@benjamn benjamn merged commit 6aeac43 into facebook:master Feb 2, 2014
@jonathanong
Copy link
Contributor

thank you!!!

@benjamn
Copy link
Collaborator

benjamn commented Feb 2, 2014

Yeah, @amasad deserves many thanks for finding a really elegant fix for this problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants