diff --git a/index.html b/index.html
index 94afdf7..514eef0 100644
--- a/index.html
+++ b/index.html
@@ -3265,12 +3265,12 @@
@media print {
@page :left {
@bottom-right {
- content: '© Ecma International 2025';
+ content: '© Ecma International 2026';
}
}
@page :right {
@bottom-left {
- content: '© Ecma International 2025';
+ content: '© Ecma International 2026';
}
}
@page :first {
@@ -3301,7 +3301,7 @@
Stage 1 Draft / October 29, 2026
Range proposal
27 Control Abstraction Objects
@@ -3330,7 +3330,7 @@ 27.1.4 The NumericRangeIterat
27.1.4.1 CreateNumericRangeIterator ( start, end, optionOrStep, type )
The abstract operation CreateNumericRangeIterator takes arguments start (a Number or a BigInt), end (an ECMAScript language value), optionOrStep (an ECMAScript language value), and type (number-range or bigint-range) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
- If start is NaN, throw a RangeError exception.
- If end is NaN, throw a RangeError exception.
- If type is number-range, then
- Assert: start is a Number.
- If end is not a Number, throw a TypeError exception.
- Let zero be +0𝔽.
- Let one be 1𝔽.
- Else,
- Assert: start is a BigInt.
- Editor's Note
Allowing all kinds of number (bigint, decimals, ...) to range from a
finite number to infinity.
- If end is not +∞𝔽 or -∞𝔽 and end is not a BigInt, throw a TypeError exception.
- Let zero be 0ℤ.
- Let one be 1ℤ.
- If start is +∞𝔽 or -∞𝔽, throw a RangeError exception.
- Let inclusiveEnd be false.
- If optionOrStep is undefined or null, then
- Let step be undefined.
- Else if optionOrStep is an Object, then
- Let step be ? Get(optionOrStep, "step").
- Set inclusiveEnd to ToBoolean(? Get(optionOrStep, "inclusive")).
- Else if type is number-range and optionOrStep is a Number, then
- Let step be optionOrStep.
- Else if type is bigint-range and optionOrStep is a BigInt, then
- Let step be optionOrStep.
- Else,
- Throw a TypeError exception.
- If step is undefined or null, then
- If end is +∞𝔽, let step be one.
- Else if end is -∞𝔽, let step be -one.
- Assert: In the next branch, end is a BigInt and start is a BigInt, or end is a Number and start is a Number.
- Else if end > start, let step be one.
- Else let step be -one.
- If step is NaN, throw a RangeError exception.
- If type is number-range and step is not a Number, throw a TypeError exception.
- Else if type is bigint-range and step is not a BigInt, throw a TypeError exception.
- If step is +∞𝔽 or -∞𝔽, throw a RangeError exception.
- If step is zero and start is not end, throw a RangeError exception.
- Let closure be a new Abstract Closure with no parameters that captures start, end, step, inclusiveEnd, zero, one and performs the following steps when called:
- If end is +∞𝔽, let ifIncrease be true.
- Else if end is -∞𝔽, let ifIncrease be false.
- Assert: In the next branch, end is a BigInt and start is a BigInt, or end is a Number and start is a Number.
- Else if end > start, let ifIncrease be true.
- Else let ifIncrease be false.
- If step > zero, let ifStepIncrease be true.
- Else let ifStepIncrease be false.
- If ifIncrease is not ifStepIncrease, return undefined.
- Let hitsEnd be false.
- Let currentCount be zero.
- NOTE: You can debug these steps at https://tc39.es/proposal-Number.range/playground.html .
- Repeat, while hitsEnd is false,
- Let currentYieldingValue be start + (step * currentCount).
- If currentYieldingValue is end, Set hitsEnd to true.
- Set currentCount to currentCount + one.
- If ifIncrease is true, then
- Assert: end is a BigInt or +∞𝔽 and currentYieldingValue is a BigInt, or end is a Number and
+ Editor's Note
Allowing all kinds of numbers (bigint, decimals, ...) to range from a
finite number to infinity.
- If end is not +∞𝔽 or -∞𝔽 and end is not a BigInt, throw a TypeError exception.
- Let zero be 0ℤ.
- Let one be 1ℤ.
- If start is +∞𝔽 or -∞𝔽, throw a RangeError exception.
- Let inclusiveEnd be false.
- If optionOrStep is undefined or null, then
- Let step be undefined.
- Else if optionOrStep is an Object, then
- Let step be ? Get(optionOrStep, "step").
- Set inclusiveEnd to ToBoolean(? Get(optionOrStep, "inclusive")).
- Else if type is number-range and optionOrStep is a Number, then
- Let step be optionOrStep.
- Else if type is bigint-range and optionOrStep is a BigInt, then
- Let step be optionOrStep.
- Else,
- Throw a TypeError exception.
- If step is undefined or null, then
- If end is +∞𝔽, let step be one.
- Else if end is -∞𝔽, let step be -one.
- Assert: In the next branch, end is a BigInt and start is a BigInt, or end is a Number and start is a Number.
- Else if end > start, let step be one.
- Else let step be -one.
- If step is NaN, throw a RangeError exception.
- If type is number-range and step is not a Number, throw a TypeError exception.
- Else if type is bigint-range and step is not a BigInt, throw a TypeError exception.
- If step is +∞𝔽 or -∞𝔽, throw a RangeError exception.
- If SameValueZero(step, zero) is true and start is not end, throw a RangeError exception.
- Let closure be a new Abstract Closure with no parameters that captures start, end, step, inclusiveEnd, zero, one and performs the following steps when called:
- If end is +∞𝔽, let ifIncrease be true.
- Else if end is -∞𝔽, let ifIncrease be false.
- Assert: In the next branch, end is a BigInt and start is a BigInt, or end is a Number and start is a Number.
- Else if end > start, let ifIncrease be true.
- Else let ifIncrease be false.
- If step > zero, let ifStepIncrease be true.
- Else let ifStepIncrease be false.
- If ifIncrease is not ifStepIncrease, return undefined.
- Let hitsEnd be false.
- Let currentCount be zero.
- NOTE: You can debug these steps at https://tc39.es/proposal-Number.range/playground.html .
- Repeat, while hitsEnd is false,
- Let currentYieldingValue be start + (step * currentCount).
- If currentYieldingValue is end, Set hitsEnd to true.
- Set currentCount to currentCount + one.
- If ifIncrease is true, then
- Assert: end is a BigInt or +∞𝔽 and currentYieldingValue is a BigInt, or end is a Number and
currentYieldingValue is a Number.
- If end is not +∞𝔽, then
- If inclusiveEnd is true, then
- If currentYieldingValue > end, return undefined.
- Else,
- If currentYieldingValue ≥ end, return undefined.
- Else,
- Assert: end is a BigInt or -∞𝔽 and currentYieldingValue is a BigInt, or end is a Number and currentYieldingValue is a Number.
- If end is not -∞𝔽, then
- If inclusiveEnd is true, then
- If end > currentYieldingValue, return undefined.
- Else,
- If end ≥ currentYieldingValue, return undefined.
- Perform ? Yield(currentYieldingValue).
- Return undefined.
- Return CreateIteratorFromClosure(closure, "%NumericRangeIteratorPrototype%", %NumericRangeIteratorPrototype%).
diff --git a/spec.emu b/spec.emu
index 00fa962..e335486 100644
--- a/spec.emu
+++ b/spec.emu
@@ -59,7 +59,7 @@ contributors: Jack Works
1. Let _one_ be *1*
𝔽.
1. Else,
1. Assert: _start_ is a BigInt.
-
Allowing all kinds of number (bigint, decimals, ...) to range from a finite number to infinity.
+
Allowing all kinds of numbers (bigint, decimals, ...) to range from a finite number to infinity.
1. If _end_ is not *+∞*
𝔽 or *-∞*
𝔽 and _end_ is not a BigInt, throw a *TypeError* exception.
1. Let _zero_ be *0*
ℤ.
1. Let _one_ be *1*
ℤ.
@@ -86,7 +86,7 @@ contributors: Jack Works
1. If _type_ is ~number-range~ and _step_ is not a Number, throw a *TypeError* exception.
1. Else if _type_ is ~bigint-range~ and _step_ is not a BigInt, throw a *TypeError* exception.
1. If _step_ is *+∞*
𝔽 or *-∞*
𝔽, throw a *RangeError* exception.
- 1. If _step_ is _zero_ and _start_ is not _end_, throw a *RangeError* exception.
+ 1. If SameValueZero(_step_, _zero_) is *true* and _start_ is not _end_, throw a *RangeError* exception.
1. Let _closure_ be a new Abstract Closure with no parameters that captures _start_, _end_, _step_, _inclusiveEnd_, _zero_, _one_ and performs the following steps when called:
1. If _end_ is *+∞*
𝔽, let _ifIncrease_ be *true*.
1. Else if _end_ is *-∞*
𝔽, let _ifIncrease_ be *false*.