From fb49a4e6d41b5da0c98147b8cfa8ad66521425ab Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 24 Nov 2026 18:59:40 -0500 Subject: [PATCH] Normative: Ignore indexed properties when in-place sorting a length-1 array Fixes #4101 --- spec.html | 1 + 1 file changed, 1 insertion(+) diff --git a/spec.html b/spec.html index 0ae2a92a82a..207cd51629e 100644 --- a/spec.html +++ b/spec.html @@ -41355,6 +41355,7 @@

Array.prototype.sort ( _comparator_ )

1. [id="step-array-sort-comparefn"] If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _obj_ be ? ToObject(*this* value). 1. [id="step-array-sort-len"] Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ ≤ 1, return _obj_. 1. Let _sortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: 1. Return ? CompareArrayElements(_x_, _y_, _comparator_). 1. [id="step-array-sortindexedproperties"] Let _sortedList_ be ? SortIndexedProperties(_obj_, _length_, _sortCompare_, ~skip-holes~).