了解Google V8的架构

Alo*_*kin 6 c# c++ v8

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

谢谢.

Rom*_*eau 3

如果您查看此处: http: //code.google.com/apis/v8/embed.html,他们在“访问动态变量”下有一个与您的示例相同的示例