I just started using JavaScript V8 and compiled a basic example from the Embedder's Guide. Now I want to bind C++ functions to the JavaScript context.
For now I only have a more or less blank class which should handle binding later on.
class Manager
{
public:
Manager()
{
context = Context::New();
}
void Bind(string Name, function<Handle<Value>(const Arguments&)> Function)
{
// bind the function to the given context
}
private:
Persistent<Context> context;
};
How can I bind a std::function
object to the JavaScript V8 context?