Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
None
-
b106
-
generic
-
generic
Description
Nashorn initializes the default ScriptContext's ENGINE_SCOPE Bindings with ScriptObjectMirror wrapping Nashorn's Global instance.
Also, if user creates Bindings using ScriptEngine.createBindings API, nashorn engine creates ScriptObjectMirror wrapping (separate) Nashorn Global instances.
But when user passes another object of another Bindings implementation as ENGINE_SCOPE - say javax.script.SimpleBindings instance or even user's own Bindings implementation class - then nashorn engine ends up using engine-wide 'default' global instance. This would confuse API user. We need to provide same isolation - separate global instance associated with any Bindings object - in all cases.
Also, if user creates Bindings using ScriptEngine.createBindings API, nashorn engine creates ScriptObjectMirror wrapping (separate) Nashorn Global instances.
But when user passes another object of another Bindings implementation as ENGINE_SCOPE - say javax.script.SimpleBindings instance or even user's own Bindings implementation class - then nashorn engine ends up using engine-wide 'default' global instance. This would confuse API user. We need to provide same isolation - separate global instance associated with any Bindings object - in all cases.