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

regression in fn.apply(arguments)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 8u40
    • 8u40
    • core-libs
    • b04
    • generic
    • generic

      When running the avatar.js test test/simple/test-pump-file2tcp.js with 8u40 b04, this error is reported -

      Exception in thread "main" java.lang.IllegalArgumentException: Argument is not an array
      at java.lang.reflect.Array.getLength(Native Method)
      at jdk.nashorn.internal.runtime.RewriteException.toObjectArray(RewriteException.java:246)
      at jdk.nashorn.internal.scripts.Script$Recompilation$833$6AAA$util$cu2$restOf.L:1$deprecate$deprecated(jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/util.js:0)
      at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:636)
      at jdk.nashorn.internal.scripts.Script$Recompilation$822$3A$test_pump_file2tcp$cu2$restOf.L:1$server(file:/home/akhil/ws/avatar-js/test/simple/test-pump-file2tcp.js:34)

      One error is that the line number in util.js is reported as zero. The actual line number in util.js where this occurs is 77 -

          return fn.apply(this, arguments);

      Adding the following diagnostic statement just before apply prints an unexpected error -

          print('applying '+fn+' args '+JSON.stringify(arguments));

      Exception in thread "main" TypeError: JSON.stringify got a cyclic data structure
      at <anonymous> (jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/util.js:77)
      at <anonymous> (file:/home/akhil/ws/avatar-js/test/simple/test-pump-file2tcp.js:34)

      Adding this statement, however, causes the test to pass

          print('applying args '+(typeof arguments));

      Merely calling typeof on arguments causes this test to pass.

            lagergren Marcus Lagergren
            akhil Akhil Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: