This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.html
209 lines (197 loc) · 11 KB
/
index.html
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!doctype html>
<head>
<meta charset="utf-8">
<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>
<title>Object.values / Object.entries</title>
<script type="application/json" id="menu-search-biblio">
[{
"type": "clause",
"id": "Object.keys",
"aoid": null,
"title": "Object.keys( O )",
"number": "1",
"location": "",
"key": "Object.keys( O )"
}, {
"type": "clause",
"id": "Object.values",
"aoid": null,
"title": "Object.values( O )",
"number": "2",
"location": "",
"key": "Object.values( O )"
}, {
"type": "clause",
"id": "Object.entries",
"aoid": null,
"title": "Object.entries( O )",
"number": "3",
"location": "",
"key": "Object.entries( O )"
}, {
"type": "clause",
"id": "EnumerableOwnProperties",
"aoid": "EnumerableOwnProperties",
"title": "EnumerableOwnProperties",
"number": "4",
"location": "",
"key": "EnumerableOwnProperties"
}, {
"type": "op",
"aoid": "EnumerableOwnProperties",
"refId": "EnumerableOwnProperties",
"location": "",
"key": "EnumerableOwnProperties"
}, {
"type": "clause",
"id": "sec-copyright-and-software-license",
"aoid": null,
"title": "Copyright & Software License",
"number": "A",
"location": "",
"key": "Copyright & Software License"
}]
</script>
</head>
<body>
<div id="menu-toggle">☰</div>
<div id="menu">
<div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search...">
<div id="menu-search-results" class="inactive"></div>
</div>
<div id="menu-toc">
<ol class="toc">
<li><span class="item-toggle-none"></span><a href="#Object.keys" title="Object.keys( O )"><span class="secnum">1</span> Object.keys( O )</a></li>
<li><span class="item-toggle-none"></span><a href="#Object.values" title="Object.values( O )"><span class="secnum">2</span> Object.values( O )</a></li>
<li><span class="item-toggle-none"></span><a href="#Object.entries" title="Object.entries( O )"><span class="secnum">3</span> Object.entries( O )</a></li>
<li><span class="item-toggle-none"></span><a href="#EnumerableOwnProperties" title="EnumerableOwnProperties"><span class="secnum">4</span> EnumerableOwnProperties</a></li>
<li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright & Software License"><span class="secnum">A</span> Copyright & Software License</a></li>
</ol>
</div>
</div>
<h1 class="version">Stage 4 Draft / March 29, 2016</h1>
<h1 class="title">Object.values / Object.entries</h1>
<emu-clause id="Object.keys">
<h1><span class="secnum">1</span>Object.keys( O )<span class="utils"><span class="anchor"><a href="#Object.keys">#</a></span></span></h1>
<p>When the
<emu-val>keys</emu-val> function is called with argument <var>O</var>, the following steps are taken:</p>
<emu-alg>
<ol>
<li>Let <var>obj</var> be ?
<emu-xref aoid="ToObject"><a href="https://tc39.github.io/ecma262#sec-toobject">ToObject</a></emu-xref>(<var>O</var>).</li>
<li>Let <var>nameList</var> be ?
<emu-xref aoid="EnumerableOwnProperties"><a href="#EnumerableOwnProperties">EnumerableOwnProperties</a></emu-xref>(<var>obj</var>,
<emu-val>"key"</emu-val>).</li>
<li>Return
<emu-xref aoid="CreateArrayFromList"><a href="https://tc39.github.io/ecma262#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>nameList</var>).
</li>
</ol>
</emu-alg>
</emu-clause>
<emu-clause id="Object.values">
<h1><span class="secnum">2</span>Object.values( O )<span class="utils"><span class="anchor"><a href="#Object.values">#</a></span></span></h1>
<p>When the
<emu-val>values</emu-val> function is called with argument <var>O</var>, the following steps are taken:</p>
<emu-alg>
<ol>
<li>Let <var>obj</var> be ?
<emu-xref aoid="ToObject"><a href="https://tc39.github.io/ecma262#sec-toobject">ToObject</a></emu-xref>(<var>O</var>).</li>
<li>Let <var>valueList</var> be ?
<emu-xref aoid="EnumerableOwnProperties"><a href="#EnumerableOwnProperties">EnumerableOwnProperties</a></emu-xref>(<var>obj</var>,
<emu-val>"value"</emu-val>).</li>
<li>Return
<emu-xref aoid="CreateArrayFromList"><a href="https://tc39.github.io/ecma262#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>valueList</var>).
</li>
</ol>
</emu-alg>
</emu-clause>
<emu-clause id="Object.entries">
<h1><span class="secnum">3</span>Object.entries( O )<span class="utils"><span class="anchor"><a href="#Object.entries">#</a></span></span></h1>
<p>When the
<emu-val>entries</emu-val> function is called with argument <var>O</var>, the following steps are taken:</p>
<emu-alg>
<ol>
<li>Let <var>obj</var> be ?
<emu-xref aoid="ToObject"><a href="https://tc39.github.io/ecma262#sec-toobject">ToObject</a></emu-xref>(<var>O</var>).</li>
<li>Let <var>entryList</var> be ?
<emu-xref aoid="EnumerableOwnProperties"><a href="#EnumerableOwnProperties">EnumerableOwnProperties</a></emu-xref>(<var>obj</var>,
<emu-val>"key+value"</emu-val>).</li>
<li>Return
<emu-xref aoid="CreateArrayFromList"><a href="https://tc39.github.io/ecma262#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>entryList</var>).
</li>
</ol>
</emu-alg>
</emu-clause>
<emu-clause id="EnumerableOwnProperties" aoid="EnumerableOwnProperties">
<h1><span class="secnum">4</span>EnumerableOwnProperties<span class="utils"><span class="anchor"><a href="#EnumerableOwnProperties">#</a></span></span></h1>
<p>When the abstract operation EnumerableOwnProperties is called with Object <var>O</var> and String <var>kind</var> the following steps are taken:</p>
<emu-alg>
<ol>
<li>Assert:
<emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is Object.</li>
<li>Let <var>ownKeys</var> be ? O.[[OwnPropertyKeys]]().</li>
<li>Let <var>properties</var> be a new empty
<emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262#sec-list-and-record-specification-type">List</a></emu-xref>.</li>
<li>Repeat, for each element <var>key</var> of <var>ownKeys</var> in
<emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262#sec-list-and-record-specification-type">List</a></emu-xref> order
<ol>
<li>If
<emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>key</var>) is String, then
<ol>
<li>Let <var>desc</var> be ? O.[[GetOwnProperty]](<var>key</var>).</li>
<li>If <var>desc</var> is not
<emu-val>undefined</emu-val> and <var>desc</var>.[[Enumerable]] is
<emu-val>true</emu-val>, then
<ol>
<li>If <var>kind</var> is
<emu-val>"key"</emu-val>, append <var>key</var> to <var>properties</var>.</li>
<li>Else,
<ol>
<li>Let <var>value</var> be ?
<emu-xref aoid="Get"><a href="https://tc39.github.io/ecma262#sec-get-o-p">Get</a></emu-xref>(<var>O</var>, <var>key</var>).</li>
<li>If <var>kind</var> is
<emu-val>"value"</emu-val>, append <var>value</var> to <var>properties</var>.</li>
<li>Else,
<ol>
<li>Assert: <var>kind</var> is
<emu-val>"key+value"</emu-val>.</li>
<li>Let <var>entry</var> be
<emu-xref aoid="CreateArrayFromList"><a href="https://tc39.github.io/ecma262#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>key</var>, <var>value</var> »).</li>
<li>Append <var>entry</var> to <var>properties</var>.</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Order the elements of <var>properties</var> so they are in the same relative order as would be produced by the Iterator that would be returned if the EnumerateObjectProperties internal method was invoked with <var>O</var>.</li>
<li>Return <var>properties</var>.
</li>
</ol>
</emu-alg>
<p>Note: The "
<emu-xref aoid="EnumerableOwnNames"><a href="https://tc39.github.io/ecma262#sec-enumerableownnames">EnumerableOwnNames</a></emu-xref>" section is deleted. Any existing references to
<emu-xref aoid="EnumerableOwnNames"><a href="https://tc39.github.io/ecma262#sec-enumerableownnames">EnumerableOwnNames</a></emu-xref>(<var>x</var>) should be changed to EnumerableOwnProperties(<var>x</var>,
<emu-val>"key"</emu-val>)</p>
</emu-clause>
<emu-annex id="sec-copyright-and-software-license">
<h1><span class="secnum">A</span>Copyright & Software License<span class="utils"><span class="anchor"><a href="#sec-copyright-and-software-license">#</a></span></span></h1>
<h2>Copyright Notice</h2>
<p>© 2016 Jordan Harband</p>
<h2>Software License</h2>
<p>All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</emu-annex>
</body>