How can I make a class method accessible in a V8 context?
I am trying to achieve something like the line below, but it's not working because lambda with captures cannot be treated as a function pointer.
Global()->Set("foo",v8::FunctionTemplate::New([this](const v8::Arguments &args) -> v8::Handle<v8::Value>{this->foo()}; return v8::Undefined()));
I'm not talking about exposing literal types like struct Point {int x,y}
, but specifically about exposing a class method or a simple callable object.