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

loadWithNewGlobal should support user supplied arguments from the caller

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • P4
    • Resolution: Fixed
    • None
    • 8
    • core-libs
    • None
    • b96
    • generic
    • generic
    • Verified

    Description

      loadWithNewGlobal API allows a script to be executed in new global scope. But caller script can't pass any argument now. Caller should be able to able to pass one or more arguments to the executed script.

      Example:

      loadWithNewGlobal({
         name: "<code>",

         script:" print(arguments[0]); "+
              " print(arguments[1]); " +
              "print(arguments[2].foo)",
         },
        "hello", 23, { foo: 33}
      );


      Should print:

      hello
      22
      33

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: