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

Additional arguments to Function.prototype.apply messes up actual arguments passed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b30
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Script:

        function func(x, y, z) {
           print(x, y, z);
        }

        function g() {
            func.apply(this, arguments, 23);
        }

        g(3, 54, 3);

        Expected: 3 54 3
        Actual: [Ljava.lang.Object;@417213 23 undefined

        8u20 works fine. jdk8u-dev and jdk9-dev have this issue.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                lagergren Marcus Lagergren
                Reporter:
                sundar Sundararajan Athijegannathan
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: