Skip to content

Commit 2562811

Browse files
sygljharb
authored andcommitted
Editorial: Make GetIterator's hint parameter required (#3021)
1 parent 956e5af commit 2562811

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

spec.html

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6819,14 +6819,13 @@ <h1>
68196819
<h1>
68206820
GetIterator (
68216821
_obj_: an ECMAScript language value,
6822-
optional _hint_: ~sync~ or ~async~,
6822+
_kind_: ~sync~ or ~async~,
68236823
): either a normal completion containing an Iterator Record or a throw completion
68246824
</h1>
68256825
<dl class="header">
68266826
</dl>
68276827
<emu-alg>
6828-
1. If _hint_ is not present, set _hint_ to ~sync~.
6829-
1. If _hint_ is ~async~, then
6828+
1. If _kind_ is ~async~, then
68306829
1. Let _method_ be ? GetMethod(_obj_, @@asyncIterator).
68316830
1. If _method_ is *undefined*, then
68326831
1. Let _syncMethod_ be ? GetMethod(_obj_, @@iterator).
@@ -9363,7 +9362,7 @@ <h1>
93639362
</emu-alg>
93649363
<emu-grammar>BindingPattern : ArrayBindingPattern</emu-grammar>
93659364
<emu-alg>
9366-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
9365+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
93679366
1. Let _result_ be Completion(IteratorBindingInitialization of |ArrayBindingPattern| with arguments _iteratorRecord_ and _environment_).
93689367
1. If _iteratorRecord_.[[Done]] is *false*, return ? IteratorClose(_iteratorRecord_, _result_).
93699368
1. Return ? _result_.
@@ -18058,7 +18057,7 @@ <h1>
1805818057
<emu-alg>
1805918058
1. Let _spreadRef_ be ? Evaluation of |AssignmentExpression|.
1806018059
1. Let _spreadObj_ be ? GetValue(_spreadRef_).
18061-
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_).
18060+
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_, ~sync~).
1806218061
1. Repeat,
1806318062
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
1806418063
1. If _next_ is *false*, return _nextIndex_.
@@ -19099,7 +19098,7 @@ <h1>Runtime Semantics: ArgumentListEvaluation ( ): either a normal completion co
1909919098
1. Let _list_ be a new empty List.
1910019099
1. Let _spreadRef_ be ? Evaluation of |AssignmentExpression|.
1910119100
1. Let _spreadObj_ be ? GetValue(_spreadRef_).
19102-
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_).
19101+
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_, ~sync~).
1910319102
1. Repeat,
1910419103
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
1910519104
1. If _next_ is *false*, return _list_.
@@ -19117,7 +19116,7 @@ <h1>Runtime Semantics: ArgumentListEvaluation ( ): either a normal completion co
1911719116
<emu-alg>
1911819117
1. Let _precedingArgs_ be ? ArgumentListEvaluation of |ArgumentList|.
1911919118
1. Let _spreadRef_ be ? Evaluation of |AssignmentExpression|.
19120-
1. Let _iteratorRecord_ be ? GetIterator(? GetValue(_spreadRef_)).
19119+
1. Let _iteratorRecord_ be ? GetIterator(? GetValue(_spreadRef_), ~sync~).
1912119120
1. Repeat,
1912219121
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
1912319122
1. If _next_ is *false*, return _precedingArgs_.
@@ -20541,19 +20540,19 @@ <h1>
2054120540
</emu-alg>
2054220541
<emu-grammar>ArrayAssignmentPattern : `[` `]`</emu-grammar>
2054320542
<emu-alg>
20544-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
20543+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
2054520544
1. Return ? IteratorClose(_iteratorRecord_, NormalCompletion(~unused~)).
2054620545
</emu-alg>
2054720546
<emu-grammar>ArrayAssignmentPattern : `[` Elision `]`</emu-grammar>
2054820547
<emu-alg>
20549-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
20548+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
2055020549
1. Let _result_ be Completion(IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_).
2055120550
1. If _iteratorRecord_.[[Done]] is *false*, return ? IteratorClose(_iteratorRecord_, _result_).
2055220551
1. Return _result_.
2055320552
</emu-alg>
2055420553
<emu-grammar>ArrayAssignmentPattern : `[` Elision? AssignmentRestElement `]`</emu-grammar>
2055520554
<emu-alg>
20556-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
20555+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
2055720556
1. If |Elision| is present, then
2055820557
1. Let _status_ be Completion(IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_).
2055920558
1. If _status_ is an abrupt completion, then
@@ -20565,14 +20564,14 @@ <h1>
2056520564
</emu-alg>
2056620565
<emu-grammar>ArrayAssignmentPattern : `[` AssignmentElementList `]`</emu-grammar>
2056720566
<emu-alg>
20568-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
20567+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
2056920568
1. Let _result_ be Completion(IteratorDestructuringAssignmentEvaluation of |AssignmentElementList| with argument _iteratorRecord_).
2057020569
1. If _iteratorRecord_.[[Done]] is *false*, return ? IteratorClose(_iteratorRecord_, _result_).
2057120570
1. Return _result_.
2057220571
</emu-alg>
2057320572
<emu-grammar>ArrayAssignmentPattern : `[` AssignmentElementList `,` Elision? AssignmentRestElement? `]`</emu-grammar>
2057420573
<emu-alg>
20575-
1. Let _iteratorRecord_ be ? GetIterator(_value_).
20574+
1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~).
2057620575
1. Let _status_ be Completion(IteratorDestructuringAssignmentEvaluation of |AssignmentElementList| with argument _iteratorRecord_).
2057720576
1. If _status_ is an abrupt completion, then
2057820577
1. If _iteratorRecord_.[[Done]] is *false*, return ? IteratorClose(_iteratorRecord_, _status_).
@@ -21903,9 +21902,9 @@ <h1>
2190321902
1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }.
2190421903
1. Else,
2190521904
1. Assert: _iterationKind_ is either ~iterate~ or ~async-iterate~.
21906-
1. If _iterationKind_ is ~async-iterate~, let _iteratorHint_ be ~async~.
21907-
1. Else, let _iteratorHint_ be ~sync~.
21908-
1. Return ? GetIterator(_exprValue_, _iteratorHint_).
21905+
1. If _iterationKind_ is ~async-iterate~, let _iteratorKind_ be ~async~.
21906+
1. Else, let _iteratorKind_ be ~sync~.
21907+
1. Return ? GetIterator(_exprValue_, _iteratorKind_).
2190921908
</emu-alg>
2191021909
</emu-clause>
2191121910

@@ -40402,7 +40401,7 @@ <h1>
4040240401
<dd>_adder_ will be invoked, with _target_ as the receiver.</dd>
4040340402
</dl>
4040440403
<emu-alg>
40405-
1. Let _iteratorRecord_ be ? GetIterator(_iterable_).
40404+
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
4040640405
1. Repeat,
4040740406
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
4040840407
1. If _next_ is *false*, return _target_.
@@ -40714,7 +40713,7 @@ <h1>Set ( [ _iterable_ ] )</h1>
4071440713
1. If _iterable_ is either *undefined* or *null*, return _set_.
4071540714
1. Let _adder_ be ? Get(_set_, *"add"*).
4071640715
1. If IsCallable(_adder_) is *false*, throw a *TypeError* exception.
40717-
1. Let _iteratorRecord_ be ? GetIterator(_iterable_).
40716+
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
4071840717
1. Repeat,
4071940718
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
4072040719
1. If _next_ is *false*, return _set_.
@@ -41153,7 +41152,7 @@ <h1>WeakSet ( [ _iterable_ ] )</h1>
4115341152
1. If _iterable_ is either *undefined* or *null*, return _set_.
4115441153
1. Let _adder_ be ? Get(_set_, *"add"*).
4115541154
1. If IsCallable(_adder_) is *false*, throw a *TypeError* exception.
41156-
1. Let _iteratorRecord_ be ? GetIterator(_iterable_).
41155+
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
4115741156
1. Repeat,
4115841157
1. Let _next_ be ? IteratorStep(_iteratorRecord_).
4115941158
1. If _next_ is *false*, return _set_.
@@ -44505,7 +44504,7 @@ <h1>Promise.all ( _iterable_ )</h1>
4450544504
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
4450644505
1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)).
4450744506
1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_).
44508-
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_)).
44507+
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)).
4450944508
1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_).
4451044509
1. Let _result_ be Completion(PerformPromiseAll(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)).
4451144510
1. If _result_ is an abrupt completion, then
@@ -44608,7 +44607,7 @@ <h1>Promise.allSettled ( _iterable_ )</h1>
4460844607
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
4460944608
1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)).
4461044609
1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_).
44611-
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_)).
44610+
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)).
4461244611
1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_).
4461344612
1. Let _result_ be Completion(PerformPromiseAllSettled(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)).
4461444613
1. If _result_ is an abrupt completion, then
@@ -44735,7 +44734,7 @@ <h1>Promise.any ( _iterable_ )</h1>
4473544734
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
4473644735
1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)).
4473744736
1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_).
44738-
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_)).
44737+
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)).
4473944738
1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_).
4474044739
1. Let _result_ be Completion(PerformPromiseAny(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)).
4474144740
1. If _result_ is an abrupt completion, then
@@ -44831,7 +44830,7 @@ <h1>Promise.race ( _iterable_ )</h1>
4483144830
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
4483244831
1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)).
4483344832
1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_).
44834-
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_)).
44833+
1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)).
4483544834
1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_).
4483644835
1. Let _result_ be Completion(PerformPromiseRace(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)).
4483744836
1. If _result_ is an abrupt completion, then

0 commit comments

Comments
 (0)