js code like this
var test = testfactory.creat();
test.send({'xxx'});
test.onopen = function() {
console.log('onopen');
}
c++ code like this
class testfactory {
public:
mytest* creat() {
reutrn new mytest();
}
}
class mytest {
public:
void send();
void onopen();
}
so, how to create a object and return to js use google v8?
Please try reading the official documentation, which explains this: https://v8.dev/docs/embed