Array.sort return a different order even when passing a function that always returns zero
Reported by
txgru...@gmail.com,
Feb 6 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: 1. Create an array with 11+ objects in it 2. Call .sort in this array passing a function that always return zero 3. The first item should not be the item zero What is the expected behavior? The array should be returned unchanged since the sort function always returns zero What went wrong? In the example at https://jsbin.com/naxumucato/1/edit?js,console the first item was the number 214 for an array with 10237 items, with 11 items the first item is 5, with 234 items the first item is 117, etc. Did this work before? N/A Chrome version: 56.0.2924.87 Channel: stable OS Version: OS X 10.11.6 Flash Version: Shockwave Flash 24.0 r0 Chrome: 56.0.2924.87 Opera: 42.0.2393.517 Firefox: 48.0.1 Safari: 10.0.3
,
Feb 7 2017
,
Feb 7 2017
Able to reproduce the issue on windows 7, Linux Ubuntu 14.04 and Mac 10.12.2 using chrome version 56.0.2924.87 and canary 58.0.3004.0. This is non regression issue as the issue seen from M30 old builds. Marking it as Untriaged to get more inputs from dev team. Thanks,
,
Feb 8 2017
The Array.sort() algorithm is not stable. See discussion in issue v8:90 etc. |
||||
►
Sign in to add a comment |
||||
Comment 1 by txgru...@gmail.com
, Feb 6 2017218 KB
218 KB View Download
264 KB
264 KB View Download
246 KB
246 KB View Download
265 KB
265 KB View Download