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: Quick fixes for CreateListFromArrayLike #3419

Merged
merged 1 commit into from
Sep 6, 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: 4 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6471,22 +6471,23 @@ <h1>
<h1>
CreateListFromArrayLike (
_obj_: an ECMAScript language value,
optional _requirePropertyKeys_: a boolean,
optional _validElementTypes_: ~all~ or ~property-key~,
): 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 _validElementTypes_ is not present, set _validElementTypes_ to ~all~.
ljharb marked this conversation as resolved.
Show resolved Hide resolved
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 _requirePropertyKeys_ is *true* and _next_ is not a property key, throw a *TypeError* exception.
1. If _validElementTypes_ is ~property-key~ 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 @@ -15884,7 +15885,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_, *true*).
1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, ~property-key~).
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