Input argument array wrapping in loadWithNewGlobal is wrong

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs
    • None
    • b100
    • generic
    • generic
    • Verified

      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..."

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

              Created:
              Updated:
              Resolved: