Closed Bug 1381466 Opened 7 years ago Closed 7 years ago

Throw TypeError when comparator is not callable in [Typed]Array.prototype.sort

Categories

(Core :: JavaScript: Standard Library, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

Per https://github.com/tc39/ecma262/commit/564b30b3b1bbba3772a2ebeb58208043713d64fe, Array.prototype.sort and %TypedArray%.prototype.sort now perform a IsCallable check when entering the method.
Attached patch bug1381466.patchSplinter Review
Another small ES2018 update:
Array.p.sort and TypedArray.p.sort now perform a IsCallable check when the comparator argument was provided.
Attachment #8887028 - Flags: review?(till)
Comment on attachment 8887028 [details] [diff] [review]
bug1381466.patch

Review of attachment 8887028 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8887028 - Flags: review?(till) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bfd711e5156c
Throw TypeError when comparator was provided, but is not callable per ES2018 draft spec. r=till
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bfd711e5156c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: