From 6d6515a69ddd723fa8e220db7928a995b2544894 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 5 Sep 2024 15:29:47 -0700 Subject: [PATCH] Editorial: `CreateListFromArrayLike`: change element type list to a 2-state enum (#3409) --- spec.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 7da8622829..bf5a1f9535 100644 --- a/spec.html +++ b/spec.html @@ -6471,7 +6471,7 @@

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

@@ -6479,7 +6479,6 @@

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.

- 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. @@ -6487,7 +6486,7 @@

1. Repeat, while _index_ < _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_. @@ -15885,7 +15884,7 @@

[[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. If _trap_ is *undefined*, then 1. Return ? _target_.[[OwnPropertyKeys]](). 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 ? _target_.[[OwnPropertyKeys]]().