Callbacks from C# to v8

May 9, 2012 at 4:11 AM


I tried to apply your patch to get callbacks working from C# to JavaScript, but I got access violations.  Do you have a working example you can resubmit with the patch?

Also, I suspect that storing the Function * is a bad idea - I think it should be stored as a PersistentHandle<>.  And you should probably store the JavascriptContext in V8FunctionWrapper and create a JavascriptScope for it.  I tried both of these, but I still get the errors.

I was able to call back successfully in the V8FunctionWrapper constructor.  I am no expert on v8, but perhaps using v8::Function.Call() outside of the context of v8::Script.Run() won't work, or requires some trick?