New issue
Advanced search Search tips

Issue 837220 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Undefined value in Array.prototype.sort not throwing error

Reported by david.sm...@googlemail.com, Apr 26 2018

Issue description

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

Steps to reproduce the problem:
1. Create an array dataset that has a number of objects
2. Each array item should have a key/value pair with an integer value
3. Remove the key/value pair from one of the items
4. Use the Array.prototype.sort method

What is the expected behavior?
I assume that when the sort finds an undefined error it should indeed error out of the sort loop and throw an error indicating such.

What went wrong?
The Array.prototype.sort method fails silently

Did this work before? N/A 

Chrome version: 66.0.3359.117  Channel: stable
OS Version: OS X 10.13.4
Flash Version: 

While not a problem with small datasets, it could be impossible to know why it's not sorting when you have very large datasets with a large number of key/value pairs.

JSFiddle: https://jsfiddle.net/grn3gkr9/
 

Comment 1 by woxxom@gmail.com, Apr 26 2018

The observed behavior is correct and matches the JavaScript specification:
https://tc39.github.io/ecma262/#sec-sortcompare
Status: WontFix (was: Unconfirmed)
Closing as per it matches the spec.

Sign in to add a comment