Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8023560

Arbitrary javax.script.Bindings objects as ENGINE_SCOPE objects are not handled as expected.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • core-libs
    • 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.

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: