我不确定我是否了解 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++ 中编写相同的东西?
谢谢。