Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8011704 Array compatibility issues from nashorn-dev alias
  3. JDK-8011974

Comparator function returning negative and positive Infinity does not work as expected with Array.prototype.sort

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • None
    • b87
    • generic
    • generic
    • Verified

    Description

      When comparator function returns negative and positive infinite values as in

       [2,1].sort(
          function(x,y) {
              return x<y? -Infinity : ( (x>y)? Infinity : 0 )
          })

      Sort does not work as expected.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: