@@ -158,12 +158,21 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
158
158
text: NewTarget; url: sec-built-in-function-objects
159
159
text: Number Type; url: sec-ecmascript-language-types-number-type
160
160
text: JSON.stringify; url: sec-json.stringify
161
+ urlPrefix: https://tc39.github.io/proposal-bigint/; spec: BIGINT
162
+ text: ToBigInt; url: #sec-to-bigint; type: abstract-op
163
+ text: BigInt; url: #sec-ecmascript-language-types-bigint-type; type: dfn
161
164
</pre>
162
165
163
166
<pre class=biblio>
164
167
{
165
168
"GEOMETRY": {
166
169
"aliasOf": "GEOMETRY-1"
170
+ },
171
+ "BIGINT": {
172
+ "href": "https://tc39.github.io/proposal-bigint/",
173
+ "title": "BigInt Specification",
174
+ "publisher": "TC39",
175
+ "status": "Stage 3 proposal"
167
176
}
168
177
}
169
178
</pre>
@@ -3010,6 +3019,9 @@ the following algorithm returns <i>true</i>.
3010
3019
</div></th>
3011
3020
<th><div>
3012
3021
<span>numeric types</span>
3022
+ </div></th>
3023
+ <th><div>
3024
+ <span>bigint</span>
3013
3025
</div></th>
3014
3026
<th><div>
3015
3027
<span>string types</span>
@@ -3044,6 +3056,7 @@ the following algorithm returns <i>true</i>.
3044
3056
<td>●</td>
3045
3057
<td>●</td>
3046
3058
<td>●</td>
3059
+ <td>●</td>
3047
3060
</tr>
3048
3061
<tr>
3049
3062
<th>numeric types</th>
@@ -3056,11 +3069,26 @@ the following algorithm returns <i>true</i>.
3056
3069
<td>●</td>
3057
3070
<td>●</td>
3058
3071
<td>●</td>
3072
+ <td>●</td>
3073
+ </tr>
3074
+ <tr>
3075
+ <th>bigint</th>
3076
+ <td class="belowdiagonal"></td>
3077
+ <td class="belowdiagonal"></td>
3078
+ <td></td>
3079
+ <td>●</td>
3080
+ <td>●</td>
3081
+ <td>●</td>
3082
+ <td>●</td>
3083
+ <td>●</td>
3084
+ <td>●</td>
3085
+ <td>●</td>
3059
3086
</tr>
3060
3087
<tr>
3061
3088
<th>string types</th>
3062
3089
<td class="belowdiagonal"></td>
3063
3090
<td class="belowdiagonal"></td>
3091
+ <td class="belowdiagonal"></td>
3064
3092
<td></td>
3065
3093
<td>●</td>
3066
3094
<td>●</td>
@@ -3074,6 +3102,7 @@ the following algorithm returns <i>true</i>.
3074
3102
<td class="belowdiagonal"></td>
3075
3103
<td class="belowdiagonal"></td>
3076
3104
<td class="belowdiagonal"></td>
3105
+ <td class="belowdiagonal"></td>
3077
3106
<td></td>
3078
3107
<td>●</td>
3079
3108
<td></td>
@@ -3087,6 +3116,7 @@ the following algorithm returns <i>true</i>.
3087
3116
<td class="belowdiagonal"></td>
3088
3117
<td class="belowdiagonal"></td>
3089
3118
<td class="belowdiagonal"></td>
3119
+ <td class="belowdiagonal"></td>
3090
3120
<td></td>
3091
3121
<td>●</td>
3092
3122
<td>●</td>
@@ -3100,6 +3130,7 @@ the following algorithm returns <i>true</i>.
3100
3130
<td class="belowdiagonal"></td>
3101
3131
<td class="belowdiagonal"></td>
3102
3132
<td class="belowdiagonal"></td>
3133
+ <td class="belowdiagonal"></td>
3103
3134
<td>(a)</td>
3104
3135
<td>●</td>
3105
3136
<td>●</td>
@@ -3113,6 +3144,7 @@ the following algorithm returns <i>true</i>.
3113
3144
<td class="belowdiagonal"></td>
3114
3145
<td class="belowdiagonal"></td>
3115
3146
<td class="belowdiagonal"></td>
3147
+ <td class="belowdiagonal"></td>
3116
3148
<td></td>
3117
3149
<td></td>
3118
3150
<td>●</td>
@@ -3126,6 +3158,7 @@ the following algorithm returns <i>true</i>.
3126
3158
<td class="belowdiagonal"></td>
3127
3159
<td class="belowdiagonal"></td>
3128
3160
<td class="belowdiagonal"></td>
3161
+ <td class="belowdiagonal"></td>
3129
3162
<td></td>
3130
3163
<td>●</td>
3131
3164
</tr>
@@ -3139,6 +3172,7 @@ the following algorithm returns <i>true</i>.
3139
3172
<td class="belowdiagonal"></td>
3140
3173
<td class="belowdiagonal"></td>
3141
3174
<td class="belowdiagonal"></td>
3175
+ <td class="belowdiagonal"></td>
3142
3176
<td></td>
3143
3177
</tr>
3144
3178
</table>
@@ -4783,7 +4817,7 @@ the [=integer types=],
4783
4817
{{unrestricted double}}.
4784
4818
4785
4819
The <dfn id="dfn-primitive-type" export>primitive types</dfn> are
4786
- {{boolean}} and the [=numeric types=].
4820
+ {{boolean}}, {{bigint}} and the [=numeric types=].
4787
4821
4788
4822
The <dfn id="dfn-string-type" export>string types</dfn> are
4789
4823
{{DOMString}}, all [=enumeration types=],
@@ -4892,6 +4926,7 @@ type.
4892
4926
"boolean"
4893
4927
"byte"
4894
4928
"octet"
4929
+ "bigint"
4895
4930
</pre>
4896
4931
4897
4932
<pre class="grammar" id="prod-UnrestrictedFloatType">
@@ -5007,6 +5042,18 @@ The [=type name=] of the
5007
5042
{{octet}} type is “Octet”.
5008
5043
5009
5044
5045
+ <h4 id="idl-bigint" interface>bigint</h4>
5046
+
5047
+ The {{bigint}} type is an arbitrary integer, unrestricted in range.
5048
+
5049
+ {{bigint}} constant values in IDL are
5050
+ represented with <emu-t class="regex"><a href="#prod-bigint">bigint</a></emu-t>
5051
+ tokens.
5052
+
5053
+ The [=type name=] of the
5054
+ {{bigint}} type is “BigInt”.
5055
+
5056
+
5010
5057
<h4 oldids="dom-short" id="idl-short" interface>short</h4>
5011
5058
5012
5059
The {{short}} type is a signed integer
@@ -6290,6 +6337,9 @@ ECMAScript value type.
6290
6337
1. If <a abstract-op>Type</a>(|V|) is Number, then
6291
6338
return the result of <a href="#es-to-unrestricted-double">converting</a> |V|
6292
6339
to an {{unrestricted double}}.
6340
+ 1. If <a abstract-op>Type</a>(|V|) is [=BigInt=], then
6341
+ return the result of <a href="#es-to-bigint">converting</a> |V|
6342
+ to an {{bigint}}.
6293
6343
1. If <a abstract-op>Type</a>(|V|) is String, then
6294
6344
return the result of <a href="#es-DOMString">converting</a> |V|
6295
6345
to a {{DOMString}}.
@@ -6720,6 +6770,27 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
6720
6770
{{unrestricted double}} value.
6721
6771
</div>
6722
6772
6773
+ <h4 id="es-bigint">bigint</h4>
6774
+
6775
+ <div id="es-to-bigint" algorithm="convert an ECMAScript value to a bigint">
6776
+
6777
+ An ECMAScript value |V| is [=converted to an IDL value|converted=]
6778
+ to an IDL {{bigint}} value by running the following algorithm:
6779
+
6780
+ 1. Let |x| be [=?=] <a abstract-op>ToBigInt</a>(|V|).
6781
+ 1. Return the IDL {{bigint}} value that represents the same numeric
6782
+ value as |x|.
6783
+ </div>
6784
+
6785
+ <div id="bigint-to-es" algorithm="convert a bigint to an ECMAScript value">
6786
+
6787
+ The result of [=converted to an ECMAScript value|converting=]
6788
+ an IDL {{bigint}} value to an ECMAScript value is a [=BigInt=]:
6789
+
6790
+ 1. Return the [=BigInt=] value that represents the same numeric value
6791
+ as the IDL {{bigint}} value.
6792
+ </div>
6793
+
6723
6794
6724
6795
<h4 id="es-DOMString">DOMString</h4>
6725
6796
@@ -9957,6 +10028,16 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
9957
10028
9958
10029
then remove from |S| all other entries.
9959
10030
10031
+ 1. Otherwise: if <a abstract-op>Type</a>(|V|) is [=BigInt=]
10032
+ and there is an entry in |S| that has one of the following types at position |i| of its type list,
10033
+ * {{bigint}}
10034
+ * a [=nullable type|nullable=] {{bigint}}
10035
+ * an [=annotated type=] whose [=annotated types/inner type=] is one of the above types
10036
+ * a [=union type=], [=nullable type|nullable=] union type, or [=annotated type|annotated=] union type
10037
+ that has one of the above types in its [=flattened member types=]
10038
+
10039
+ then remove from |S| all other entries.
10040
+
9960
10041
1. Otherwise: if there is an entry in |S| that has one of the following types at position |i| of its type list,
9961
10042
* a [=string type=]
9962
10043
* a [=nullable type|nullable=] version of any of the above types
@@ -13046,6 +13127,11 @@ expression syntax [[!PERLRE]]) as follows:
13046
13127
<td><code>=</code></td>
13047
13128
<td><code class="regex"><span class="mute">/</span>-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)<span class="mute">/</span></code></td>
13048
13129
</tr>
13130
+ <tr>
13131
+ <td id="prod-bigint"><emu-t class="regex">bigint</emu-t></td>
13132
+ <td><code>=</code></td>
13133
+ <td><code class="regex"><span class="mute">/</span>-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)n<span class="mute">/</span></code></td>
13134
+ </tr>
13049
13135
<tr>
13050
13136
<td id="prod-identifier"><emu-t class="regex">identifier</emu-t></td>
13051
13137
<td><code>=</code></td>
0 commit comments