On Thu, Nov 24, 2016 at 4:45 AM,  <[email protected]> wrote:
> 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

I don't know if Chrome does it in C++ or JS but it executes the moral
equivalent of:

    Object.defineProperty(this, Symbol.toStringTag, { configurable:
true, value: 'Window' });

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to