我不确定我是否了解V8的架构(是的,我已阅读其文档)。
在带有v8sharp包装器的C#中,我写了这样的东西,例如:
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);");
}
}
如果没有这个包装器,我如何在标准C ++中编写相同的东西?
感谢。