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

Input argument array wrapping in loadWithNewGlobal is wrong

    XMLWordPrintable

Details

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

    Description

      By code inspection I found that loadWithNewGlobal uses wrong global instance (new global created rather than caller's global) to wrap input arguments.

      Test:

      loadWithNewGlobal({
          name: "test",
          script: "arguments[0]();"
      }, func);

      function func() {
          try {
              foo;
          } catch (e) {
              if (! (e instanceof ReferenceError)) {
                  print("FAILED: expected ReferenceError!");
              }
          }
      }


      Should not print "FAILED..."

      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: