Skip to content

Commit

Permalink
Normative: TypedArray.prototype.sort: comparefn must be fn or undef…
Browse files Browse the repository at this point in the history
…ined

This requires implementations throw a `TypeError` when the compare
function is neither undefined nor a function, which is currently vaguely
implied but not explicitly required.
  • Loading branch information
ljharb committed Jun 10, 2017
1 parent 96cefda commit f0ee1d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -32671,6 +32671,7 @@ <h1>%TypedArray%.prototype.sort ( _comparefn_ )</h1>
<p>This function is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.</p>
<p>Upon entry, the following steps are performed to initialize evaluation of the `sort` function. These steps are used instead of the entry steps in <emu-xref href="#sec-array.prototype.sort"></emu-xref>:</p>
<emu-alg>
1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception.
1. Let _obj_ be the *this* value.
1. Let _buffer_ be ? ValidateTypedArray(_obj_).
1. Let _len_ be _obj_.[[ArrayLength]].
Expand Down

0 comments on commit f0ee1d2

Please sign in to comment.