From ba4e87a924fb1a033cfa6cb02d2e14f6a65f2c80 Mon Sep 17 00:00:00 2001 From: Ashley Claymore Date: Wed, 29 Jun 2022 16:48:15 +0100 Subject: [PATCH] normative: TA::toSpliced process deleteCount before items (#91) --- spec.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec.html b/spec.html index d693007..b6d68ea 100644 --- a/spec.html +++ b/spec.html @@ -424,12 +424,6 @@

%TypedArray%.prototype.toSpliced ( _start_, _deleteCount_, ..._items_ )

1. If _relativeStart_ is -∞, let _actualStart_ be 0. 1. Else if _relativeStart_ < 0, let _actualStart_ be max(_len_ + _relativeStart_, 0). 1. Else, let _actualStart_ be min(_relativeStart_, _len_). - 1. Let _insertCount_ be the number of elements in _items_. - 1. Let _convertedItems_ be a new empty List. - 1. For each element _E_ of _items_, do - 1. If _O_.[[ContentType]] is ~BigInt~, let _convertedValue_ be ? ToBigInt(_E_). - 1. Else, let _convertedValue_ be ? ToNumber(_E_). - 1. Append _convertedValue_ as the last element of _convertedItems_. 1. If _start_ is not present, then 1. Let _actualDeleteCount_ be 0. 1. Else if _deleteCount_ is not present, then @@ -437,6 +431,12 @@

%TypedArray%.prototype.toSpliced ( _start_, _deleteCount_, ..._items_ )

1. Else, 1. Let _dc_ be ? ToIntegerOrInfinity(_deleteCount_). 1. Let _actualDeleteCount_ be the result of clamping _dc_ between 0 and _len_ - _actualStart_. + 1. Let _insertCount_ be the number of elements in _items_. + 1. Let _convertedItems_ be a new empty List. + 1. For each element _E_ of _items_, do + 1. If _O_.[[ContentType]] is ~BigInt~, let _convertedValue_ be ? ToBigInt(_E_). + 1. Else, let _convertedValue_ be ? ToNumber(_E_). + 1. Append _convertedValue_ as the last element of _convertedItems_. 1. Let _newLen_ be _len_ + _insertCount_ - _actualDeleteCount_. 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_newLen_) »). 1. Let _i_ be 0.