New issue
Advanced search Search tips

Issue 896385 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Oct 18
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 857372



Sign in to add a comment

es5 Sorting algorithm change causes breakage

Reported by kkaul1...@gmail.com, Oct 17

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36

Steps to reproduce the problem:
With the old sorting algorithm, we were relying on the sorting being called twice, for each combination of variables.
sort(a.x,b.y) would check twice for both (a.x with b.y) and with (b.x with a.y)
We were relying on this functionality in our project which is now broken because of the algorithm update.

What is the expected behavior?

What went wrong?
Algorithm update caused old functionality to break.

Did this work before? N/A 

Chrome version: 70.0.3538.67  Channel: stable
OS Version: OS X 10.14.0
Flash Version:
 
Relying on an implementation quirk is always a bad idea but I guess this should be investigated by someone from  issue 857372 .
Cc: jgruber@chromium.org
Components: -Blink Blink>JavaScript
Ya it seems odd to rely on this functionality since it varied between browsers. 

Can you provide more details of your project so we determine impact?
Labels: Needs-Triage-M70
Blocking: 857372
Status: WontFix (was: Unconfirmed)
The order and number of comparison calls in Array.p.sort is completely unspecced and not something you rely on. Is it possible to change your project's implementation?

See https://tc39.github.io/ecma262/#sec-array.prototype.sort for more details.
The project is for quite a big corporation that caters to some other major companies like big airlines with this project. I believe the implementation can be changed but it will take some time. Is there an interim solution?
Besides implementing your own sorting algorithm (and possibly monkey-patching Array.p.sort) or not relying on implementation details, I'm afraid there isn't. 
Cc: -jgruber@chromium.org
Owner: jgruber@chromium.org

Sign in to add a comment