I'm trying to get behavior similar to that of the global object in a Chrome JavaScript context through the V8 API. I've created a FunctionTemplate, called SetClassName on the template, set various properties on its PrototypeTemplate and InstanceTemplate, and then used the InstanceTemplate to create a context. However, when I run Object.prototype.toString.call(this), I get [object Object], instead of what I set the class name to. How does Chrome make it so that Object.prototype.toString.call(this) is [object Window]?
Thanks,
~Theodore