From ea0f873f254d3307152e805992ddcf51179e0d8b Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 20 May 2026 09:47:03 +0200 Subject: [PATCH] Normative: use Numbers for counters instead of mathematical values --- spec.emu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec.emu b/spec.emu index c42bf43..2e656d7 100644 --- a/spec.emu +++ b/spec.emu @@ -16,22 +16,22 @@ copyright: false 1. If _O_ is not an Object, throw a *TypeError* exception. 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. 1. If _skippedElements_ is *undefined*, then - 1. Let _toSkip_ be 0. + 1. Let _toSkip_ be *+0*𝔽. 1. Else, 1. If _skippedElements_ is not one of *+∞𝔽*, *-∞𝔽*, or an integral Number, then 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iterated_, _error_). - 1. Let _toSkip_ be the extended mathematical value of _skippedElements_. - 1. If _toSkip_ < 0, then + 1. Let _toSkip_ be _skippedElements_. + 1. If _toSkip_ < *-0*𝔽, then 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). 1. Return ? IteratorClose(_iterated_, _error_). - 1. Let _skipped_ be 0. + 1. Let _skipped_ be *+0*𝔽. 1. Set _iterated_ to ? GetIteratorDirect(_O_). 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return *false*. 1. If _skipped_ < _toSkip_, then - 1. Set _skipped_ to _skipped_ + 1. + 1. Set _skipped_ to _skipped_ + *1*𝔽. 1. Else if SameValueZero(_value_, _searchElement_) is *true*, then 1. Return ? IteratorClose(_iterated_, NormalCompletion(*true*)).