I am doing some parallel work with uv_queue_work in a node.js c++ addon.
Everything works fine until I try to callback to JS from the Complete method.
I get: CHECK(thread_local_top()->TryCatchHandler() == that) failed.
Any pointers as to what could be causing this?
I am using the following code to callback:
//Get emit method from JS object and check !IsEmpty and IsFunction
v8::TryCatch tc;
emit->Call(pxy,1,argv); // The error happens in this statement.
if (tc.HasCaught()){
//Some handler code
}
OK, not sure exactly why the error was happening, but I was able to make it go away by using node::MakeCallback instead of emit->Call.
Really unsure as to why this is happening, and a little worried as there has been talk about deprecating MakeCallback...
Edit: I would be happy to accept any answer that can shed light on this. Hopefully the use of MakeCallback" saves someone else in the meantime :)