Seems to me that what you're trying to do won't work. You may be able to create a global object template and call ReattachGlobalObject(globalTemplate->NewInstance()), but I haven't tried that.
On Jun 26, 2012, at 8:34 AM, MikeM wrote: > > Array function in one context is different from Array function in > > another context as each context is a separate world with it's own > > built-in objects. > Right. That was the purpose of the ReattachGlobal() in the code. > My idea (possibly mis-guided), was to re-use the same set of built-in objects > (or prototypes) between different executions. > So that instanceOf would work properly. How can I re-use the same built-ins > each time? > I suppose I could keep using the same Context over and over, but I would need > a way to wipe out any local var declarations between executions and only keep > the built-ins. > > > You can use Array.isArray which should work cross-context. > Also what about strings or custom objects of our own? > > function foo() {} > var x = new foo(); > x instanceof foo; > > Thanks! > > > > > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users