Somewhat confused about ENGINE_SCOPE and GLOBAL_SCOPE binding in Nashorn, trying to follow the discussion here.
Before reading this my understanding of scopes (at least in rhino) was that there's a single, shared Bindings in the GLOBAL_SCOPE and individual bindings in ENGINE_SCOPE for each individual engine. However this page seems to be saying that each individual engine stores the basic javascript constructs in bindings that exist in the engines ENGINE_SCOPE (confusingly called the "Nashorn Global Scope"). This sounds like it makes the GLOBAL_SCOPE bindings effectively useless (because they won't have access to any of those basic constructs).
What I'm trying to do is create a context that I can inject a few scripts into, and then repeatedly eval different bindings in the context of those scripts. However if the only context I can access is the individual engines ENGINE_SCOPE (because anything above that won't have access to basic javascript constructs) then it seems that any local invocation has to add to those same bindings. Does anyone know how to manage multiple levels of bindings in Nashorn?