Linking to prototypes and loadWithNewGlobal

Eric Pederson ericacm at
Sat Mar 12 02:59:38 UTC 2016

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?


-- Eric

More information about the nashorn-dev mailing list