我不确定我是否理解 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);");
}
}
如果没有这个包装器,我如何用标准 C++ 编写相同的东西?
谢谢。
最佳答案
如果你看这里:http://code.google.com/apis/v8/embed.html他们在“访问动态变量”下有一个与您相同的示例
关于c# - 了解 Google V8 的架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3129373/