This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
generated from tc39/template-for-proposals
-
Notifications
You must be signed in to change notification settings - Fork 6
/
spec.emu
40 lines (37 loc) · 1.46 KB
/
spec.emu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!doctype html>
<meta charset="utf8">
<link rel="stylesheet" href="./spec.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="./spec.js"></script>
<pre class="metadata">
title: Object iteration
stage: 2
contributors: Jonathan Keslin
</pre>
<emu-clause id="Object_iterateKeys">
<h1>Object.iterateKeys( O )</h1>
<p>When the *iterateKeys* function is called with argument _O_, the following steps are taken:</p>
<emu-alg>
1. Let _obj_ be ? ToObject(_O_).
1. Let _nameList_ be ? EnumerableOwnProperties(_obj_, ~key~).
1. Return CreateArrayIterator(CreateArrayFromList(_nameList_), ~key~).
</emu-alg>
</emu-clause>
<emu-clause id="Object_iterateValues">
<h1>Object.iterateValues( O )</h1>
<p>When the *iterateValues* function is called with argument _O_, the following steps are taken:</p>
<emu-alg>
1. Let _obj_ be ? ToObject(_O_).
1. Let _valueList_ be ? EnumerableOwnProperties(_obj_, ~value~).
1. Return CreateArrayIterator(CreateArrayFromList(_valueList_), ~value~).
</emu-alg>
</emu-clause>
<emu-clause id="Object_iterateEntries">
<h1>Object.iterateEntries( O )</h1>
<p>When the *iterateEntries* function is called with argument _O_, the following steps are taken:</p>
<emu-alg>
1. Let _obj_ be ? ToObject(_O_).
1. Let _entryList_ be ? EnumerableOwnProperties(_obj_, ~key+value~).
1. Return CreateArrayIterator(CreateArrayFromList(_entryList_), ~key+value~).
</emu-alg>
</emu-clause>