Details

    • Sub-task
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • None
    • b22
    • generic
    • generic

    Backports

      Description

        File: applyonapply.js

        var sort = Array.prototype.sort;
        var sorted = Function.prototype.apply.apply(sort, [[4, 3, 89, 7]]);
        print(sorted);

        Expected: 3,4,7,89 ( - works fine on jdk8 and jdk8u)

        Stack trace with jdk9 is as follows:

        jjs -doe applyonapply.js

        applyonapppply.js:2 TypeError: [Ljava.lang.Object;@1f95560 is not an Object
        applyonapppply.js:2 TypeError: [Ljava.lang.Object;@1f95560 is not an Object
        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:214)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:186)
        at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:173)
        at jdk.nashorn.internal.objects.NativeArray.sort(NativeArray.java:1152)
        at jdk.nashorn.internal.scripts.Script$Recompilation$2$applyonapppply$cu2$restOf.:program(applyonapppply.js:2)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:567)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:221)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:374)
        at jdk.nashorn.tools.Shell.apply(Shell.java:391)
        at jdk.nashorn.tools.Shell.runScripts(Shell.java:320)
        at jdk.nashorn.tools.Shell.run(Shell.java:169)
        at jdk.nashorn.tools.Shell.main(Shell.java:133)
        at jdk.nashorn.tools.Shell.main(Shell.java:112)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: