If you are using the API to build your object then you can try the following:
Local<FunctionTemplate> func_templ(FunctionTemplate::New());func_templ->SetClassName(String::NewSymbol("ClassName"));Local<ObjectTemplate> obj_templ = func_templ->InstanceTemplate(); On Friday, October 11, 2013 5:04:36 AM UTC+3, ChaRles Lew wrote: > > Hi, i've been reading ECMAScript specification recently. I've learned that > Object.prototype.toString will generate a string like [object <[[Class]]>] > for objects. > And I'm curious how can I customize the [[Class]] internal property for my > objects. Or shall i just rewrite this method and fake this behavior? > > By the way, in Chrome when <this> is the window object, > this.toString() => "[object window]" > but > Object.prototype.toString.call(this) => "[object global]" > Hey...The app i'm writing has a similar behavior and will use the global > object in a similar way, how shall i avoid [object global] appearing? I > want to ensure (at least pretend) its [[Class]] internal property is > "window" etc. > > Looking forward for advice. Thanks. > -- -- v8-users mailing list v8-users@googlegroups.com 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 v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.