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: CreateListFromArrayLike: change element type list to a 2-state enum #3409

Merged
merged 1 commit into from
Sep 5, 2024
Merged
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
7 changes: 3 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6471,23 +6471,22 @@ <h1>
<h1>
CreateListFromArrayLike (
_obj_: an ECMAScript language value,
optional _elementTypes_: a List of names of ECMAScript Language Types,
optional _requirePropertyKeys_: a boolean,
): either a normal completion containing a List of ECMAScript language values or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It is used to create a List value whose elements are provided by the indexed properties of _obj_. _elementTypes_ contains the names of ECMAScript Language Types that are allowed for element values of the List that is created.</dd>
</dl>
<emu-alg>
1. If _elementTypes_ is not present, set _elementTypes_ to « Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object ».
1. If _obj_ is not an Object, throw a *TypeError* exception.
1. Let _len_ be ? LengthOfArrayLike(_obj_).
1. Let _list_ be a new empty List.
1. Let _index_ be 0.
1. Repeat, while _index_ &lt; _len_,
1. Let _indexName_ be ! ToString(𝔽(_index_)).
1. Let _next_ be ? Get(_obj_, _indexName_).
1. If _elementTypes_ does not contain Type(_next_), throw a *TypeError* exception.
1. If _requirePropertyKeys_ is *true* and _next_ is not a property key, throw a *TypeError* exception.
1. Append _next_ to _list_.
1. Set _index_ to _index_ + 1.
1. Return _list_.
Expand Down Expand Up @@ -15885,7 +15884,7 @@ <h1>[[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro
1. If _trap_ is *undefined*, then
1. Return ? <emu-meta effects="user-code">_target_.[[OwnPropertyKeys]]()</emu-meta>.
1. Let _trapResultArray_ be ? Call(_trap_, _handler_, « _target_ »).
1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, « String, Symbol »).
1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, *true*).
1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception.
1. Let _extensibleTarget_ be ? IsExtensible(_target_).
1. Let _targetKeys_ be ? <emu-meta effects="user-code">_target_.[[OwnPropertyKeys]]()</emu-meta>.
Expand Down
Loading