As explained in #12, it's sometimes desirable to re-use the same Script Engine in multiple threads, with each thread having it's own Bindings defining the global scope. I added an overload to Require that does just this. The Module still gets passed the NashornScriptEngine reference, but I think that's OK since it only uses it to access engine scope and create a few standard JS objects.
As explained in #12, it's sometimes desirable to re-use the same Script Engine in multiple threads, with each thread having it's own
Bindings
defining the global scope. I added an overload toRequire
that does just this. TheModule
still gets passed theNashornScriptEngine
reference, but I think that's OK since it only uses it to access engine scope and create a few standard JS objects.