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

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b87
    • generic
    • generic
    • Verified

      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.

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

              Created:
              Updated:
              Resolved: