How to sort array without changing order of same values

I agree. If we change the comparison function slightly we get all the right answers.

function comp (a,b)
   { if(a.points<b.points){ return -1 }
   if(a.points>b.points){ return +1 }
   else 
   { if(a.name<b.name){ return -1 }
   if(a.name>b.name){ return +1 } 
   else return 0 
   }
  }  

This works for all values of points and all duplications of names.