I am working on a Node module and trying to pass an instance of a class that subclasses ObjectWrapas an argument to a JavaScript callback.
In other places, I was able to successfully decompress JavaScript objects into one class using:
GitCommit *commit = ObjectWrap::Unwrap<GitCommit>(args[0]->ToObject());
How can I do the opposite? I want to pass an instance GitCommitto a JavaScript callback, for example:
Local<Value> argv[] = {
Local<Value>::New(Integer::New(0)),
commit
};
ar->callback->Call(Context::GetCurrent()->Global(), 1, argv);
Is it possible? If so, please give me an example or a link to the relevant documentation?
source
share