@@ -192,12 +192,21 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
192
192
text: own property; url: sec-own-property
193
193
text: Property Descriptor; url: sec-property-descriptor-specification-type
194
194
text: realm; url: realm
195
+ urlPrefix: https://tc39.github.io/proposal-bigint/; spec: BIGINT
196
+ text: ToBigInt; url: #sec-to-bigint; type: abstract-op
197
+ text: BigInt; url: #sec-ecmascript-language-types-bigint-type; type: dfn
195
198
</pre>
196
199
197
200
<pre class=biblio>
198
201
{
199
202
"GEOMETRY": {
200
203
"aliasOf": "GEOMETRY-1"
204
+ },
205
+ "BIGINT": {
206
+ "href": "https://tc39.github.io/proposal-bigint/",
207
+ "title": "BigInt Specification",
208
+ "publisher": "TC39",
209
+ "status": "Stage 3 proposal"
201
210
}
202
211
}
203
212
</pre>
@@ -1591,7 +1600,8 @@ constant declaration gives the value of the constant, which can be
1591
1600
one of the two boolean literal tokens (<emu-t>true</emu-t>
1592
1601
and <emu-t>false</emu-t>),
1593
1602
the <emu-t>null</emu-t> token, an
1594
- <emu-t class="regex"><a href="#prod-integer">integer</a></emu-t> token,
1603
+ <emu-t class="regex"><a href="#prod-integer">integer</a></emu-t> token, a
1604
+ <emu-t class="regex"><a href="#prod-bigint">bigint</a></emu-t> token,
1595
1605
a <emu-t class="regex"><a href="#prod-float">float</a></emu-t> token,
1596
1606
or one of the three special floating point constant values
1597
1607
(<emu-t>-Infinity</emu-t>, <emu-t>Infinity</emu-t> and <emu-t>NaN</emu-t>).
@@ -1733,6 +1743,7 @@ The following extended attributes are applicable to constants:
1733
1743
BooleanLiteral
1734
1744
FloatLiteral
1735
1745
integer
1746
+ bigint
1736
1747
"null"
1737
1748
</pre>
1738
1749
@@ -3467,6 +3478,9 @@ the following algorithm returns <i>true</i>.
3467
3478
</div></th>
3468
3479
<th><div>
3469
3480
<span>numeric types</span>
3481
+ </div></th>
3482
+ <th><div>
3483
+ <span>bigint</span>
3470
3484
</div></th>
3471
3485
<th><div>
3472
3486
<span>string types</span>
@@ -3501,6 +3515,7 @@ the following algorithm returns <i>true</i>.
3501
3515
<td>●</td>
3502
3516
<td>●</td>
3503
3517
<td>●</td>
3518
+ <td>●</td>
3504
3519
</tr>
3505
3520
<tr>
3506
3521
<th>numeric types</th>
@@ -3513,11 +3528,26 @@ the following algorithm returns <i>true</i>.
3513
3528
<td>●</td>
3514
3529
<td>●</td>
3515
3530
<td>●</td>
3531
+ <td>●</td>
3532
+ </tr>
3533
+ <tr>
3534
+ <th>bigint</th>
3535
+ <td class="belowdiagonal"></td>
3536
+ <td class="belowdiagonal"></td>
3537
+ <td></td>
3538
+ <td>●</td>
3539
+ <td>●</td>
3540
+ <td>●</td>
3541
+ <td>●</td>
3542
+ <td>●</td>
3543
+ <td>●</td>
3544
+ <td>●</td>
3516
3545
</tr>
3517
3546
<tr>
3518
3547
<th>string types</th>
3519
3548
<td class="belowdiagonal"></td>
3520
3549
<td class="belowdiagonal"></td>
3550
+ <td class="belowdiagonal"></td>
3521
3551
<td></td>
3522
3552
<td>●</td>
3523
3553
<td>●</td>
@@ -3531,6 +3561,7 @@ the following algorithm returns <i>true</i>.
3531
3561
<td class="belowdiagonal"></td>
3532
3562
<td class="belowdiagonal"></td>
3533
3563
<td class="belowdiagonal"></td>
3564
+ <td class="belowdiagonal"></td>
3534
3565
<td></td>
3535
3566
<td>●</td>
3536
3567
<td></td>
@@ -3544,6 +3575,7 @@ the following algorithm returns <i>true</i>.
3544
3575
<td class="belowdiagonal"></td>
3545
3576
<td class="belowdiagonal"></td>
3546
3577
<td class="belowdiagonal"></td>
3578
+ <td class="belowdiagonal"></td>
3547
3579
<td></td>
3548
3580
<td>●</td>
3549
3581
<td>●</td>
@@ -3557,6 +3589,7 @@ the following algorithm returns <i>true</i>.
3557
3589
<td class="belowdiagonal"></td>
3558
3590
<td class="belowdiagonal"></td>
3559
3591
<td class="belowdiagonal"></td>
3592
+ <td class="belowdiagonal"></td>
3560
3593
<td>(a)</td>
3561
3594
<td>●</td>
3562
3595
<td>●</td>
@@ -3570,6 +3603,7 @@ the following algorithm returns <i>true</i>.
3570
3603
<td class="belowdiagonal"></td>
3571
3604
<td class="belowdiagonal"></td>
3572
3605
<td class="belowdiagonal"></td>
3606
+ <td class="belowdiagonal"></td>
3573
3607
<td></td>
3574
3608
<td></td>
3575
3609
<td>●</td>
@@ -3583,6 +3617,7 @@ the following algorithm returns <i>true</i>.
3583
3617
<td class="belowdiagonal"></td>
3584
3618
<td class="belowdiagonal"></td>
3585
3619
<td class="belowdiagonal"></td>
3620
+ <td class="belowdiagonal"></td>
3586
3621
<td></td>
3587
3622
<td>●</td>
3588
3623
</tr>
@@ -3596,6 +3631,7 @@ the following algorithm returns <i>true</i>.
3596
3631
<td class="belowdiagonal"></td>
3597
3632
<td class="belowdiagonal"></td>
3598
3633
<td class="belowdiagonal"></td>
3634
+ <td class="belowdiagonal"></td>
3599
3635
<td></td>
3600
3636
</tr>
3601
3637
</table>
@@ -5355,7 +5391,7 @@ the [=integer types=],
5355
5391
{{unrestricted double}}.
5356
5392
5357
5393
The <dfn id="dfn-primitive-type" export>primitive types</dfn> are
5358
- {{boolean}} and the [=numeric types=].
5394
+ {{boolean}}, {{bigint}} and the [=numeric types=].
5359
5395
5360
5396
The <dfn id="dfn-string-type" export>string types</dfn> are
5361
5397
{{DOMString}}, all [=enumeration types=],
@@ -5463,6 +5499,7 @@ type.
5463
5499
"boolean"
5464
5500
"byte"
5465
5501
"octet"
5502
+ "bigint"
5466
5503
</pre>
5467
5504
5468
5505
<pre class="grammar" id="prod-UnrestrictedFloatType">
@@ -5578,6 +5615,18 @@ The [=type name=] of the
5578
5615
{{octet}} type is "<code>Octet</code>".
5579
5616
5580
5617
5618
+ <h4 id="idl-bigint" interface>bigint</h4>
5619
+
5620
+ The {{bigint}} type is an arbitrary integer, unrestricted in range.
5621
+
5622
+ {{bigint}} constant values in IDL are
5623
+ represented with <emu-t class="regex"><a href="#prod-bigint">bigint</a></emu-t>
5624
+ tokens.
5625
+
5626
+ The [=type name=] of the
5627
+ {{bigint}} type is “BigInt”.
5628
+
5629
+
5581
5630
<h4 oldids="dom-short" id="idl-short" interface>short</h4>
5582
5631
5583
5632
The {{short}} type is a signed integer
@@ -6864,6 +6913,9 @@ ECMAScript value type.
6864
6913
1. If <a abstract-op>Type</a>(|V|) is Number, then
6865
6914
return the result of <a href="#es-to-unrestricted-double">converting</a> |V|
6866
6915
to an {{unrestricted double}}.
6916
+ 1. If <a abstract-op>Type</a>(|V|) is [=BigInt=], then
6917
+ return the result of <a href="#es-to-bigint">converting</a> |V|
6918
+ to an {{bigint}}.
6867
6919
1. If <a abstract-op>Type</a>(|V|) is String, then
6868
6920
return the result of <a href="#es-DOMString">converting</a> |V|
6869
6921
to a {{DOMString}}.
@@ -7294,6 +7346,27 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
7294
7346
{{unrestricted double}} value.
7295
7347
</div>
7296
7348
7349
+ <h4 id="es-bigint">bigint</h4>
7350
+
7351
+ <div id="es-to-bigint" algorithm="convert an ECMAScript value to a bigint">
7352
+
7353
+ An ECMAScript value |V| is [=converted to an IDL value|converted=]
7354
+ to an IDL {{bigint}} value by running the following algorithm:
7355
+
7356
+ 1. Let |x| be [=?=] <a abstract-op>ToBigInt</a>(|V|).
7357
+ 1. Return the IDL {{bigint}} value that represents the same numeric
7358
+ value as |x|.
7359
+ </div>
7360
+
7361
+ <div id="bigint-to-es" algorithm="convert a bigint to an ECMAScript value">
7362
+
7363
+ The result of [=converted to an ECMAScript value|converting=]
7364
+ an IDL {{bigint}} value to an ECMAScript value is a [=BigInt=]:
7365
+
7366
+ 1. Return the [=BigInt=] value that represents the same numeric value
7367
+ as the IDL {{bigint}} value.
7368
+ </div>
7369
+
7297
7370
7298
7371
<h4 id="es-DOMString">DOMString</h4>
7299
7372
@@ -7988,23 +8061,37 @@ that correspond to the union’s [=member types=].
7988
8061
1. If |types| includes {{object}}, then return the IDL value
7989
8062
that is a reference to the object |V|.
7990
8063
1. If <a abstract-op>Type</a>(|V|) is Boolean, then:
7991
- 1. If |types| includes a {{boolean}},
8064
+ 1. If |types| includes {{boolean}},
7992
8065
then return the result of [=converted to an IDL value|converting=]
7993
8066
|V| to {{boolean}}.
7994
8067
1. If <a abstract-op>Type</a>(|V|) is Number, then:
7995
8068
1. If |types| includes a [=numeric type=],
7996
8069
then return the result of [=converted to an IDL value|converting=]
7997
8070
|V| to that [=numeric type=].
8071
+ 1. If <a abstract-op>Type</a>(|V|) is Symbol, then:
8072
+ 1. If |types| includes {{symbol}},
8073
+ then return the result of [=converted to an IDL value|converting=]
8074
+ |V| to {{symbol}}
8075
+ 1. If <a abstract-op>Type</a>(|V|) is [=BigInt=], then:
8076
+ 1. If |types| includes {{bigint}},
8077
+ then return the result of [=converted to an IDL value|converting=]
8078
+ |V| to {{bigint}}
7998
8079
1. If |types| includes a [=string type=],
7999
8080
then return the result of
8000
8081
[=converted to an IDL value|converting=]
8001
8082
|V| to that type.
8002
8083
1. If |types| includes a [=numeric type=],
8003
8084
then return the result of [=converted to an IDL value|converting=]
8004
8085
|V| to that [=numeric type=].
8005
- 1. If |types| includes a {{boolean}},
8086
+ 1. If |types| includes {{boolean}},
8006
8087
then return the result of [=converted to an IDL value|converting=]
8007
8088
|V| to {{boolean}}.
8089
+ 1. If |types| includes {{symbol}},
8090
+ then return the result of [=converted to an IDL value|converting=]
8091
+ |V| to {{symbol}}.
8092
+ 1. If |types| includes a {{bigint}},
8093
+ then return the result of [=converted to an IDL value|converting=]
8094
+ |V| to {{bigint}}.
8008
8095
1. [=ECMAScript/Throw=] a {{ECMAScript/TypeError}}.
8009
8096
</div>
8010
8097
@@ -10592,6 +10679,16 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
10592
10679
10593
10680
then remove from |S| all other entries.
10594
10681
10682
+ 1. Otherwise: if <a abstract-op>Type</a>(|V|) is [=BigInt=]
10683
+ and there is an entry in |S| that has one of the following types at position |i| of its type list,
10684
+ * {{bigint}}
10685
+ * a [=nullable type|nullable=] {{bigint}}
10686
+ * an [=annotated type=] whose [=annotated types/inner type=] is one of the above types
10687
+ * a [=union type=], [=nullable type|nullable=] union type, or [=annotated type|annotated=] union type
10688
+ that has one of the above types in its [=flattened member types=]
10689
+
10690
+ then remove from |S| all other entries.
10691
+
10595
10692
1. Otherwise: if there is an entry in |S| that has one of the following types at position |i| of its type list,
10596
10693
* a [=string type=]
10597
10694
* a [=nullable type|nullable=] version of any of the above types
@@ -13568,6 +13665,11 @@ expression syntax [[!PERLRE]]) as follows:
13568
13665
<td><code>=</code></td>
13569
13666
<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>
13570
13667
</tr>
13668
+ <tr>
13669
+ <td id="prod-bigint"><emu-t class="regex">bigint</emu-t></td>
13670
+ <td><code>=</code></td>
13671
+ <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>
13672
+ </tr>
13571
13673
<tr>
13572
13674
<td id="prod-identifier"><emu-t class="regex">identifier</emu-t></td>
13573
13675
<td><code>=</code></td>
0 commit comments