|
4 | 4 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css"> |
5 | 5 | <script src="./spec.js"></script> |
6 | 6 | <pre class="metadata"> |
7 | | -title: Object.keysLength, Object.getOwnPropertyNamesLength, Object.getOwnPropertySymbolsLength |
| 7 | +title: Performant object property counting (index) |
8 | 8 | stage: 1 |
9 | 9 | contributors: Ruben Bridgewater, Jordan Harband |
10 | 10 | </pre> |
11 | 11 |
|
12 | | -<emu-clause id="sec-object-keyslength"> |
13 | | - <h1>Object.keysLength ( _target_ )</h1> |
14 | | - <p>When the `Object.keysLength` method is called, the following steps are taken:</p> |
15 | | - <emu-alg> |
16 | | - 1. If _target_ is not an Object, throw a *TypeError* exception. |
17 | | - 1. Let _count_ be 0. |
18 | | - 1. Let _ownKeys_ be ? _target_.[[OwnPropertyKeys]](). |
19 | | - 1. For each element _key_ of _ownKeys_, do |
20 | | - 1. If _key_ is a String, then |
21 | | - 1. Let _desc_ be ? _target_.[[GetOwnProperty]](_key_). |
22 | | - 1. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then |
23 | | - 1. Set _count_ to _count_ + 1. |
24 | | - 1. Return 𝔽(_count_). |
25 | | - </emu-alg> |
26 | | -</emu-clause> |
27 | | - |
28 | | -<emu-clause id="sec-object-getownpropertynameslength"> |
29 | | - <h1>Object.getOwnPropertyNamesLength ( _target_ )</h1> |
30 | | - <p>When the `Object.getOwnPropertyNamesLength` method is called, the following steps are taken:</p> |
31 | | - <emu-alg> |
32 | | - 1. If _target_ is not an Object, throw a *TypeError* exception. |
33 | | - 1. Let _count_ be 0. |
34 | | - 1. Let _ownKeys_ be ? _target_.[[OwnPropertyKeys]](). |
35 | | - 1. For each element _key_ of _ownKeys_, do |
36 | | - 1. If _key_ is a String, then |
37 | | - 1. Set _count_ to _count_ + 1. |
38 | | - 1. Return 𝔽(_count_). |
39 | | - </emu-alg> |
40 | | -</emu-clause> |
41 | | - |
42 | | -<emu-clause id="sec-object-getownpropertysymbolslength"> |
43 | | - <h1>Object.getOwnPropertySymbolsLength ( _target_ )</h1> |
44 | | - <p>When the `Object.getOwnPropertySymbolsLength` method is called, the following steps are taken:</p> |
45 | | - <emu-alg> |
46 | | - 1. If _target_ is not an Object, throw a *TypeError* exception. |
47 | | - 1. Let _count_ be 0. |
48 | | - 1. Let _ownKeys_ be ? _target_.[[OwnPropertyKeys]](). |
49 | | - 1. For each element _key_ of _ownKeys_, do |
50 | | - 1. If _key_ is a Symbol, then |
51 | | - 1. Set _count_ to _count_ + 1. |
52 | | - 1. Return 𝔽(_count_). |
53 | | - </emu-alg> |
54 | | -</emu-clause> |
| 12 | +<emu-intro id="sec-index-intro"> |
| 13 | + <h1>Overview</h1> |
| 14 | + <p>This index groups the specification work for performant object property counting methods that avoid intermediate array allocation. Each item is a separate, independently-advancable proposal.</p> |
| 15 | + <ul> |
| 16 | + <li><a href="./spec-keyslength.html">Object.keysLength</a> — counts own enumerable string-keyed properties.</li> |
| 17 | + <li><a href="./spec-names-symbols-length.html">Object.getOwnPropertyNamesLength & Object.getOwnPropertySymbolsLength</a> — counts own string-keyed (all) and own symbol-keyed (all) properties.</li> |
| 18 | + </ul> |
| 19 | +</emu-intro> |
0 commit comments