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

loadWithNewGlobal return value has to be properly wrapped

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • core-libs
    • None
    • b94
    • generic
    • generic
    • Verified

    Description

      loadWithNewGlobal runs given script in a new 'global' instance. The return result could be a script object -- such an object should be properly wrapped. If not, it will start referring/using objects from caller's "world".

      Example:

      var glob = loadWithNewGlobal(
        { name: "<code>",
           script: "function func() { return [] }; this;"
        })

      // should print false - not an Array of caller's global
      print(glob.func() instanceof Array)

      // should print false - not an Object from caller's global
      print(glob instanceof Object)

      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: