我不确定我是否了解V8的架构(是的,我已经阅读了它的文档).
在C#中使用v8sharp包装器我写了这样的东西,例如:
namespace App
{
class Point
{
public Point() { }
public Point(double x, double y) {
this.X = x;
this.Y = y;
}
public double X { get; set; }
public double Y { get; set; }
}
}
static class Program
{
static void Main() {
//registering with v8sharp
V8Engine engine = V8Engine.Create();
engine.Register<App.Point>();
//execute javascript
object rtn = engine.Execute("new App.Point(10, 10);");
}
}
Run Code Online (Sandbox Code Playgroud)
如果没有这个包装器,我将如何在标准C++中编写相同的东西?
谢谢.