Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: use new IteratorStepValue AO #2765

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"main": "polyfill/lib/index.mjs",
"devDependencies": {
"@tc39/ecma262-biblio": "=2.1.2663",
"@tc39/ecma262-biblio": "=2.1.2678",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"ecmarkup": "^18.1.2",
Expand Down
18 changes: 8 additions & 10 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ <h1>
</dl>
<emu-alg>
1. Let _values_ be a new empty List.
1. Let _next_ be *true*.
1. Repeat, while _next_ is not *false*,
1. Set _next_ to ? IteratorStep(_iteratorRecord_).
1. If _next_ is not *false*, then
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not an element of _elementTypes_, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _nextValue_ to the end of the List _values_.
1. Return _values_.
1. Repeat,
1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
1. If _next_ is ~done~, then
1. Return _values_.
1. If Type(_next_) is not an element of _elementTypes_, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _next_ to the end of the List _values_.
</emu-alg>
</emu-clause>

Expand Down
30 changes: 14 additions & 16 deletions spec/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -1744,22 +1744,20 @@ <h1>Temporal.Calendar.prototype.fields ( _fields_ )</h1>
1. Assert: _calendar_.[[Identifier]] is *"iso8601"*.
1. Let _iteratorRecord_ be ? GetIterator(_fields_, ~sync~).
1. Let _fieldNames_ be a new empty List.
1. Let _next_ be *true*.
1. Repeat, while _next_ is not *false*,
1. Set _next_ to ? IteratorStep(_iteratorRecord_).
1. If _next_ is not *false*, then
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not String, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _fieldNames_ contains _nextValue_, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _nextValue_ is not one of *"year"*, *"month"*, *"monthCode"*, or *"day"*, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _nextValue_ to the end of the List _fieldNames_.
1. Return CreateArrayFromList(_fieldNames_).
1. Repeat,
1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
1. If _next_ is ~done~, then
1. Return CreateArrayFromList(_fieldNames_).
1. If _next_ is not a String, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _fieldNames_ contains _next_, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _next_ is not one of *"year"*, *"month"*, *"monthCode"*, or *"day"*, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _next_ to the end of the List _fieldNames_.
</emu-alg>
</emu-clause>

Expand Down
21 changes: 10 additions & 11 deletions spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -2640,21 +2640,20 @@ <h1>Temporal.Calendar.prototype.fields ( _fields_ )</h1>
1. Perform ? RequireInternalSlot(_calendar_, [[InitializedTemporalCalendar]]).
1. Let _iteratorRecord_ be ? GetIterator(_fields_, ~sync~).
1. Let _fieldNames_ be a new empty List.
1. Let _next_ be *true*.
1. Repeat, while _next_ is not *false*,
1. Set _next_ to ? IteratorStep(_iteratorRecord_).
1. If _next_ is not *false*, then
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not String, then
1. Let _next_ be *undefined*.
1. Repeat, while _next_ is not ~done~,
1. Set _next_ to ? IteratorStepValue(_iteratorRecord_).
1. If _next_ is not ~done~, then
1. If _next_ is not a String, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _fieldNames_ contains _nextValue_, then
1. If _fieldNames_ contains _next_, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. If _nextValue_ is not one of *"year"*, *"month"*, *"monthCode"*, or *"day"*, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _nextValue_ to the end of the List _fieldNames_.
1. If _next_ is not one of *"year"*, *"month"*, *"monthCode"*, or *"day"*, then
1. Let _completion_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _next_ to the end of the List _fieldNames_.
1. Let _result_ be _fieldNames_.
1. If _calendar_.[[Identifier]] is not *"iso8601"*, then
1. NOTE: Every built-in calendar preserves all input field names in output.
Expand Down
18 changes: 8 additions & 10 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -975,16 +975,14 @@ <h1>
1. If TimeZoneMethodsRecordIsBuiltin(_timeZoneRec_), return ! CreateListFromArrayLike(_possibleInstants_, « Object »).
1. Let _iteratorRecord_ be ? GetIterator(_possibleInstants_, ~sync~).
1. Let _list_ be a new empty List.
1. Let _next_ be *true*.
1. Repeat, while _next_ is not *false*,
1. Set _next_ to ? IteratorStep(_iteratorRecord_).
1. If _next_ is not *false*, then
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not Object or _nextValue_ does not have an [[InitializedTemporalInstant]] internal slot, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _nextValue_ to the end of the List _list_.
1. Return _list_.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iteratorRecord_).
1. If _value_ is ~done~, then
1. Return _list_.
1. If _value_ is not an Object or _value_ does not have an [[InitializedTemporalInstant]] internal slot, then
1. Let _completion_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Append _value_ to the end of the List _list_.
</emu-alg>
</emu-clause>

Expand Down
Loading