This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
/
index.html
310 lines (281 loc) · 12.1 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!doctype html>
<meta charset="utf8">
<pre class="metadata">
title: Exponentiation Operator
status: proposal
stage: 4
location: https://github.com/rwaldron/exponentiation-operator
copyright: false
contributors: Rick Waldron
</pre>
<style>
emu-production.inline emu-mods {
display: none;
}
</style>
<title>Exponentiation Operator</title>
<!-- es6num="12.4" -->
<emu-clause id="sec-update-expressions">
<h1>Update Expressions</h1>
<h2>Syntax</h2>
<emu-grammar>
UpdateExpression[Yield] :
LeftHandSideExpression[?Yield]
LeftHandSideExpression[?Yield] [no LineTerminator here] `++`
LeftHandSideExpression[?Yield] [no LineTerminator here] `--`
`++` UnaryExpression[?Yield]
`--` UnaryExpression[?Yield]
</emu-grammar>
<!-- es6num="12.4.1" -->
<emu-clause id="sec-update-expressions-static-semantics-early-errors">
<h1>Static Semantics: Early Errors</h1>
<emu-grammar>
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
</emu-grammar>
<ul>
<li>
It is an early Reference Error if IsValidSimpleAssignmentTarget of |LeftHandSideExpression| is *false*.
</li>
</ul>
<emu-grammar>
UpdateExpression :
`++` UnaryExpression
`--` UnaryExpression
</emu-grammar>
<ul>
<li>
It is an early Reference Error if IsValidSimpleAssignmentTarget of |UnaryExpression| is *false*.
</li>
</ul>
</emu-clause>
<!-- es6num="12.4.2" -->
<emu-clause id="sec-update-expressions-static-semantics-isfunctiondefinition">
<h1>Static Semantics: IsFunctionDefinition</h1>
<emu-see-also-para op="IsFunctionDefinition"></emu-see-also-para>
<emu-grammar>
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
`++` UnaryExpression
`--` UnaryExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
<!-- es6num="12.4.3" -->
<emu-clause id="sec-update-expressions-static-semantics-isvalidsimpleassignmenttarget">
<h1>Static Semantics: IsValidSimpleAssignmentTarget</h1>
<emu-see-also-para op="IsValidSimpleAssignmentTarget"></emu-see-also-para>
<emu-grammar>
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
`++` UnaryExpression
`--` UnaryExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
<!-- es6num="12.4.4" -->
<emu-clause id="sec-postfix-increment-operator">
<h1>Postfix Increment Operator</h1>
<!-- es6num="12.4.4.1" -->
<emu-clause id="sec-postfix-increment-operator-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UpdateExpression : LeftHandSideExpression `++`</emu-grammar>
<emu-alg>
1. Let _lhs_ be the result of evaluating |LeftHandSideExpression|.
1. Let _oldValue_ be ? ToNumber(? GetValue(_lhs_)).
1. Let _newValue_ be the result of adding the value `1` to _oldValue_, using the same rules as for the `+` operator (see <emu-xref href="#sec-applying-the-additive-operators-to-numbers"></emu-xref>).
1. Perform ? PutValue(_lhs_, _newValue_).
1. Return _oldValue_.
</emu-alg>
</emu-clause>
</emu-clause>
<!-- es6num="12.4.5" -->
<emu-clause id="sec-postfix-decrement-operator">
<h1>Postfix Decrement Operator</h1>
<!-- es6num="12.4.5.1" -->
<emu-clause id="sec-postfix-decrement-operator-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UpdateExpression : LeftHandSideExpression `--`</emu-grammar>
<emu-alg>
1. Let _lhs_ be the result of evaluating |LeftHandSideExpression|.
1. Let _oldValue_ be ? ToNumber(? GetValue(_lhs_)).
1. Let _newValue_ be the result of subtracting the value `1` from _oldValue_, using the same rules as for the `-` operator (<emu-xref href="#sec-applying-the-additive-operators-to-numbers"></emu-xref>).
1. Perform ? PutValue(_lhs_, _newValue_).
1. Return _oldValue_.
</emu-alg>
</emu-clause>
</emu-clause>
<!-- es6num="12.5.7" -->
<emu-clause id="sec-prefix-increment-operator">
<h1>Prefix Increment Operator</h1>
<!-- es6num="12.5.7.1" -->
<emu-clause id="sec-prefix-increment-operator-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UpdateExpression : `++` UnaryExpression</emu-grammar>
<emu-alg>
1. Let _expr_ be the result of evaluating |UnaryExpression|.
1. Let _oldValue_ be ? ToNumber(? GetValue(_expr_)).
1. Let _newValue_ be the result of adding the value `1` to _oldValue_, using the same rules as for the `+` operator (see <emu-xref href="#sec-applying-the-additive-operators-to-numbers"></emu-xref>).
1. Perform ? PutValue(_expr_, _newValue_).
1. Return _newValue_.
</emu-alg>
</emu-clause>
</emu-clause>
<!-- es6num="12.5.8" -->
<emu-clause id="sec-prefix-decrement-operator">
<h1>Prefix Decrement Operator</h1>
<!-- es6num="12.5.8.1" -->
<emu-clause id="sec-prefix-decrement-operator-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UpdateExpression : `--` UnaryExpression</emu-grammar>
<emu-alg>
1. Let _expr_ be the result of evaluating |UnaryExpression|.
1. Let _oldValue_ be ? ToNumber(? GetValue(_expr_)).
1. Let _newValue_ be the result of subtracting the value `1` from _oldValue_, using the same rules as for the `-` operator (see <emu-xref href="#sec-applying-the-additive-operators-to-numbers"></emu-xref>).
1. Perform ? PutValue(_expr_, _newValue_).
1. Return _newValue_.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="sec-exp-operator">
<h1>Exponentiation Operator</h1>
<h2>Syntax</h2>
<emu-grammar>
ExponentiationExpression[Yield] :
UnaryExpression[?Yield]
UpdateExpression[?Yield] `**` ExponentiationExpression[?Yield]
</emu-grammar>
<emu-clause id="sec-exp-operator-static-semantics-isfunctiondefinition">
<h1>Static Semantics: IsFunctionDefinition</h1>
<emu-see-also-para op="IsFunctionDefinition"></emu-see-also-para>
<emu-grammar>
ExponentiationExpression :
UpdateExpression `**` ExponentiationExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
<emu-clause id="sec-exp-operator-static-semantics-isvalidsimpleassignmenttarget">
<h1>Static Semantics: IsValidSimpleAssignmentTarget</h1>
<emu-see-also-para op="IsValidSimpleAssignmentTarget"></emu-see-also-para>
<emu-grammar>
ExponentiationExpression :
UpdateExpression `**` ExponentiationExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
<emu-clause id="sec-exp-operator-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>
ExponentiationExpression : UpdateExpression `**` ExponentiationExpression
</emu-grammar>
<emu-alg>
1. Let _left_ be the result of evaluating _UpdateExpression_.
1. Let _leftValue_ be ? GetValue(_left_).
1. Let _right_ be the result of evaluating _ExponentiationExpression_.
1. Let _rightValue_ be ? GetValue(_right_).
1. Let _base_ be ? ToNumber(_leftValue_).
1. Let _exponent_ be ? ToNumber(_rightValue_).
1. Return the result of <emu-xref href="#sec-applying-the-exp-operator" title>Applying the ** operator</emu-xref> with _base_ and _exponent_ as specified in <emu-xref href="#sec-applying-the-exp-operator"></emu-xref>.
</emu-alg>
</emu-clause>
</emu-clause>
<!-- es6num="12.5" -->
<emu-clause id="sec-unary-operators">
<h1>Unary Operators</h1>
<h2>Syntax</h2>
<emu-grammar>
UnaryExpression[Yield] :
UpdateExpression[?Yield]
`delete` UnaryExpression[?Yield]
`void` UnaryExpression[?Yield]
`typeof` UnaryExpression[?Yield]
`+` UnaryExpression[?Yield]
`-` UnaryExpression[?Yield]
`~` UnaryExpression[?Yield]
`!` UnaryExpression[?Yield]
</emu-grammar>
<!-- es6num="12.5.2" -->
<emu-clause id="sec-unary-operators-static-semantics-isfunctiondefinition">
<h1>Static Semantics: IsFunctionDefinition</h1>
<emu-see-also-para op="IsFunctionDefinition"></emu-see-also-para>
<emu-grammar>
UnaryExpression :
UpdateExpression
`delete` UnaryExpression
`void` UnaryExpression
`typeof` UnaryExpression
`+` UnaryExpression
`-` UnaryExpression
`~` UnaryExpression
`!` UnaryExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
<!-- es6num="12.5.3" -->
<emu-clause id="sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">
<h1>Static Semantics: IsValidSimpleAssignmentTarget</h1>
<emu-see-also-para op="IsValidSimpleAssignmentTarget"></emu-see-also-para>
<emu-grammar>
UnaryExpression :
UpdateExpression
`delete` UnaryExpression
`void` UnaryExpression
`typeof` UnaryExpression
`+` UnaryExpression
`-` UnaryExpression
`~` UnaryExpression
`!` UnaryExpression
</emu-grammar>
<emu-alg>
1. Return *false*.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-applying-the-exp-operator">
<h1>Applying the ** operator</h1>
<p>
Returns an implementation-dependent approximation of the result of raising _base_ to the power _exponent_.
</p>
<ul>
<li>If _exponent_ is *NaN*, the result is *NaN*.</li>
<li>If _exponent_ is +0, the result is 1, even if _base_ is *NaN*.</li>
<li>If _exponent_ is −0, the result is 1, even if _base_ is *NaN*.</li>
<li>If _base_ is *NaN* and _exponent_ is nonzero, the result is *NaN*.</li>
<li>If abs(_base_) > 1 and _exponent_ is +∞, the result is +∞.</li>
<li>If abs(_base_) > 1 and _exponent_ is −∞, the result is +0.</li>
<li>If abs(_base_) is 1 and _exponent_ is +∞, the result is *NaN*.</li>
<li>If abs(_base_) is 1 and _exponent_ is −∞, the result is *NaN*.</li>
<li>If abs(_base_) < 1 and _exponent_ is +∞, the result is +0.</li>
<li>If abs(_base_) < 1 and _exponent_ is −∞, the result is +∞.</li>
<li>If _base_ is +∞ and _exponent_ > 0, the result is +∞.</li>
<li>If _base_ is +∞ and _exponent_ < 0, the result is +0.</li>
<li>If _base_ is −∞ and _exponent_ > 0 and _exponent_ is an odd integer, the result is −∞.</li>
<li>If _base_ is −∞ and _exponent_ > 0 and _exponent_ is not an odd integer, the result is +∞.</li>
<li>If _base_ is −∞ and _exponent_ < 0 and _exponent_ is an odd integer, the result is −0.</li>
<li>If _base_ is −∞ and _exponent_ < 0 and _exponent_ is not an odd integer, the result is +0.</li>
<li>If _base_ is +0 and _exponent_ > 0, the result is +0.</li>
<li>If _base_ is +0 and _exponent_ < 0, the result is +∞.</li>
<li>If _base_ is −0 and _exponent_ > 0 and _exponent_ is an odd integer, the result is −0.</li>
<li>If _base_ is −0 and _exponent_ > 0 and _exponent_ is not an odd integer, the result is +0.</li>
<li>If _base_ is −0 and _exponent_ < 0 and _exponent_ is an odd integer, the result is −∞.</li>
<li>If _base_ is −0 and _exponent_ < 0 and _exponent_ is not an odd integer, the result is +∞.</li>
<li>If _base_ < 0 and _base_ is finite and _exponent_ is finite and _exponent_ is not an integer, the result is *NaN*.</li>
</ul>
</emu-clause>
</emu-clause>
<emu-import href="./modifications.html"></emu-import>
<emu-import href="./annex.html"></emu-import>