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

javaarrayconversion.js test is flawed

    XMLWordPrintable

Details

    • b83
    • generic
    • generic

    Backports

      Description

        test/script/basic/javaarrayconversion.js asserts that an array of java objects can't be convert to a primitive Java array using the line:
         Java.to([new Java.type(sourceType)()], targetType + "[]"
        expecting a TypeError. However the caught TypeError is actually "function type() { [native code] } is not a constructor function" because new is called on Java.type, not its result. So it should instead be:
         Java.to([new (Java.type(sourceType))()], targetType + "[]");
        After this change the test fails with "no TypeError encountered" what suggests a bug in Nashorn.

        Attachments

          Issue Links

            Activity

              People

                sundar Sundararajan Athijegannathan
                aw Andreas Woess
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: