Yes, object from different (global) "world" are represented as ScriptObjectMirror instances. Those are "almost" objects in that usual foo.bar, foo.func() etc. would work - but those are still "foreign" objects (just like Java objects are). And so such objects can not be as proto (just as a Java object like a java.util.ArrayList instance can not be).
Thanks -Sundar On 3/12/2016 8:29 AM, Eric Pederson wrote: > I am trying to link to a prototype of a function loaded through > loadWithNewGlobal. For example: > > var Foo = loadWithNewGlobal("foo.js"); > > var foo = Object.create(Foo.prototype); > > > This throws an exception: TypeError: [object Object] is not an Object. > > It works ok if I load the function using plain load(). > > Is this expected? > > Thanks, > > -- Eric