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

7 #550

Merged
merged 3 commits into from
May 7, 2017
Merged

7 #550

merged 3 commits into from
May 7, 2017

Conversation

tjanczuk
Copy link
Owner

@tjanczuk tjanczuk commented May 7, 2017

No description provided.

dpolivy and others added 3 commits May 5, 2017 13:41
Calling v8::Function::Call directly for async callbacks leads to very
odd behavior in some circumstances, specifically the next tick of the
event loop seems to get stuck. After much digging, I found references to
this being a "known" issue, and the proper way to call async functions
in JS is to use the node::MakeCallback helper, or the Nan equivalent. In
some cases, we also use the Nan::Callback object as a helper for
managing JS callbacks.

KNOWN ISSUES: On node <v6, it seems that exceptions thrown from JS when
called from .NET do NOT propagate back to .NET correctly. Instead, they
terminate the JS process. This appears to be a known limitation of using
the MakeCallback method, with no easy workarounds. On 6.4.0, this test
does pass, which indicates the issue has been fixed in node.
The previous fixes to use Nan::MakeCallback had the side effect of
swallowing exceptions on Node <v6, which was a regression. To retain
that behavior, we revert the JS execution calls to using Nan::Call
instead of Nan::MakeCallback, and instead explicitly kick the next tick
with a no-op function.
@tjanczuk tjanczuk merged commit 1185005 into master May 7, 2017
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.

2 participants