On Thu, Dec 1, 2016 at 5:09 PM, Thomas Barusseau
> I'm having a hard time making this piece of code work. Basically, I need to
> take a node.js function (in this case : `process.emit()`),
> store it in a C++ class, and use it at runtime whenever a callback method is
> Here is the code :
> And here is gdb's output :
> Could anyone help me with that? There's no doubt my code has stupid things
> in it.
> I've read a lot of documentation today but somehow I can't figure out some
> things and I'm stuck trying things without fully understanding
> the big picture...
> Thanks in advance.
>From your gist:
Local<Context> context = isolate->GetCurrentContext();
context->Enter(); // /!\ SIGSEGV HAPPENS HERE /!\
I bet that context.IsEmpty() is true. You could move this line up:
Local<Function> lpe = Local<Function>::New(isolate, process_emit);
And then you can get its context with lpe->CreationContext().
One last word of advice: conditionally creating a new isolate when
Isolate::GetCurrent() returns NULL is not going to work. Objects and
functions are intrinsically tied to the isolate that created them.
v8-users mailing list
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.