Issue metadata
Sign in to add a comment
|
Array .sort reordering results even if you always return 0
Reported by
matthias...@gmail.com,
Sep 3
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Steps to reproduce the problem:
1. Make a array with objects and one field has all duplicates
2. Do a arr.sort((a, b) => { return 0; }); on the array
3. The values should have been shifted somehow
Maybe the easiest way: (in firefox this works fine )
https://stackblitz.com/edit/angular-s6us3z
What is the expected behavior?
That the value's stay at the same order!
What went wrong?
The values chance order
Did this work before? Yes
Chrome version: 68.0.3440.106 Channel: stable
OS Version: 10.0
Flash Version:
,
Sep 4
,
Sep 4
matthiasschaekels96@ Thanks for the update. Able to reproduce this issue on Windows 10, Mac OS 10.13.3 and Ubuntu 17.10 on the reported version 68.0.3440.106 and latest Beta 69.0.3497.72. Issue seems to be fixed on the latest Canary 71.0.3541.0. Revert Bisect Information: ========================== Good Build: 70.0.3531.0 Bad Build : 70.0.3530.0 By running per-revision bisect script, RunTimeError was coming up. Hence by running Chromium bisect below is the Changelog URL. https://chromium.googlesource.com/chromium/src/+log/ac0405676146ce76211b297659aecd91714564f5..548ac6ffdaac420fbc90a96f09104ef401bc2c38 https://chromium.googlesource.com/chromium/src/+/d21143ef8f069bf5a18f7b3f4c3ec600350794ee From the above Changelog, suspecting the below change: Reviewed-on: https://chromium-review.googlesource.com/1151199 szuend@ Please check and confirm if this issue is related to your change, else help us in assigning to the right owner. Adding 'ReleaseBlock-Stable' for M-69 as this is a recent regression. Please feel free to remove if it is not applicable. Thanks
,
Sep 4
,
Sep 4
Array.prototype.sort was never stable (see https://crbug.com/v8/90 ) until now. The change that introduced stable sorting was briefly in 68 and 69 Canary releases (which makes a bisect harder) but always reverted before branch points. The final reland happened with 70.0.3533.0 (assuming no further issues arise). |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by viswa.karala@chromium.org
, Sep 3