@@ -192,12 +192,21 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
192192 text: own property; url: sec-own-property
193193 text: Property Descriptor; url: sec-property-descriptor-specification-type
194194 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
195198</pre>
196199
197200<pre class=biblio>
198201{
199202 "GEOMETRY": {
200203 "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"
201210 }
202211}
203212</pre>
@@ -1591,7 +1600,8 @@ constant declaration gives the value of the constant, which can be
15911600one of the two boolean literal tokens (<emu-t>true</emu-t>
15921601and <emu-t>false</emu-t>),
15931602the <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,
15951605a <emu-t class="regex"><a href="#prod-float">float</a></emu-t> token,
15961606or one of the three special floating point constant values
15971607(<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:
17331743 BooleanLiteral
17341744 FloatLiteral
17351745 integer
1746+ bigint
17361747 "null"
17371748</pre>
17381749
@@ -3467,6 +3478,9 @@ the following algorithm returns <i>true</i>.
34673478 </div></th>
34683479 <th><div>
34693480 <span>numeric types</span>
3481+ </div></th>
3482+ <th><div>
3483+ <span>bigint</span>
34703484 </div></th>
34713485 <th><div>
34723486 <span>string types</span>
@@ -3501,6 +3515,7 @@ the following algorithm returns <i>true</i>.
35013515 <td>●</td>
35023516 <td>●</td>
35033517 <td>●</td>
3518+ <td>●</td>
35043519 </tr>
35053520 <tr>
35063521 <th>numeric types</th>
@@ -3513,11 +3528,26 @@ the following algorithm returns <i>true</i>.
35133528 <td>●</td>
35143529 <td>●</td>
35153530 <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>
35163545 </tr>
35173546 <tr>
35183547 <th>string types</th>
35193548 <td class="belowdiagonal"></td>
35203549 <td class="belowdiagonal"></td>
3550+ <td class="belowdiagonal"></td>
35213551 <td></td>
35223552 <td>●</td>
35233553 <td>●</td>
@@ -3531,6 +3561,7 @@ the following algorithm returns <i>true</i>.
35313561 <td class="belowdiagonal"></td>
35323562 <td class="belowdiagonal"></td>
35333563 <td class="belowdiagonal"></td>
3564+ <td class="belowdiagonal"></td>
35343565 <td></td>
35353566 <td>●</td>
35363567 <td></td>
@@ -3544,6 +3575,7 @@ the following algorithm returns <i>true</i>.
35443575 <td class="belowdiagonal"></td>
35453576 <td class="belowdiagonal"></td>
35463577 <td class="belowdiagonal"></td>
3578+ <td class="belowdiagonal"></td>
35473579 <td></td>
35483580 <td>●</td>
35493581 <td>●</td>
@@ -3557,6 +3589,7 @@ the following algorithm returns <i>true</i>.
35573589 <td class="belowdiagonal"></td>
35583590 <td class="belowdiagonal"></td>
35593591 <td class="belowdiagonal"></td>
3592+ <td class="belowdiagonal"></td>
35603593 <td>(a)</td>
35613594 <td>●</td>
35623595 <td>●</td>
@@ -3570,6 +3603,7 @@ the following algorithm returns <i>true</i>.
35703603 <td class="belowdiagonal"></td>
35713604 <td class="belowdiagonal"></td>
35723605 <td class="belowdiagonal"></td>
3606+ <td class="belowdiagonal"></td>
35733607 <td></td>
35743608 <td></td>
35753609 <td>●</td>
@@ -3583,6 +3617,7 @@ the following algorithm returns <i>true</i>.
35833617 <td class="belowdiagonal"></td>
35843618 <td class="belowdiagonal"></td>
35853619 <td class="belowdiagonal"></td>
3620+ <td class="belowdiagonal"></td>
35863621 <td></td>
35873622 <td>●</td>
35883623 </tr>
@@ -3596,6 +3631,7 @@ the following algorithm returns <i>true</i>.
35963631 <td class="belowdiagonal"></td>
35973632 <td class="belowdiagonal"></td>
35983633 <td class="belowdiagonal"></td>
3634+ <td class="belowdiagonal"></td>
35993635 <td></td>
36003636 </tr>
36013637 </table>
@@ -5355,7 +5391,7 @@ the [=integer types=],
53555391{{unrestricted double}}.
53565392
53575393The <dfn id="dfn-primitive-type" export>primitive types</dfn> are
5358- {{boolean}} and the [=numeric types=].
5394+ {{boolean}}, {{bigint}} and the [=numeric types=].
53595395
53605396The <dfn id="dfn-string-type" export>string types</dfn> are
53615397{{DOMString}}, all [=enumeration types=],
@@ -5463,6 +5499,7 @@ type.
54635499 "boolean"
54645500 "byte"
54655501 "octet"
5502+ "bigint"
54665503</pre>
54675504
54685505<pre class="grammar" id="prod-UnrestrictedFloatType">
@@ -5578,6 +5615,18 @@ The [=type name=] of the
55785615{{octet}} type is "<code>Octet</code>".
55795616
55805617
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+
55815630<h4 oldids="dom-short" id="idl-short" interface>short</h4>
55825631
55835632The {{short}} type is a signed integer
@@ -6864,6 +6913,9 @@ ECMAScript value type.
68646913 1. If <a abstract-op>Type</a>(|V|) is Number, then
68656914 return the result of <a href="#es-to-unrestricted-double">converting</a> |V|
68666915 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}}.
68676919 1. If <a abstract-op>Type</a>(|V|) is String, then
68686920 return the result of <a href="#es-DOMString">converting</a> |V|
68696921 to a {{DOMString}}.
@@ -7294,6 +7346,27 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
72947346 {{unrestricted double}} value.
72957347</div>
72967348
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+
72977370
72987371<h4 id="es-DOMString">DOMString</h4>
72997372
@@ -7988,23 +8061,30 @@ that correspond to the union’s [=member types=].
79888061 1. If |types| includes {{object}}, then return the IDL value
79898062 that is a reference to the object |V|.
79908063 1. If <a abstract-op>Type</a>(|V|) is Boolean, then:
7991- 1. If |types| includes a {{boolean}},
8064+ 1. If |types| includes {{boolean}},
79928065 then return the result of [=converted to an IDL value|converting=]
79938066 |V| to {{boolean}}.
79948067 1. If <a abstract-op>Type</a>(|V|) is Number, then:
79958068 1. If |types| includes a [=numeric type=],
79968069 then return the result of [=converted to an IDL value|converting=]
79978070 |V| to that [=numeric type=].
8071+ 1. If <a abstract-op>Type</a>(|V|) is [=BigInt=], then:
8072+ 1. If |types| includes {{bigint}},
8073+ then return the result of [=converted to an IDL value|converting=]
8074+ |V| to {{bigint}}
79988075 1. If |types| includes a [=string type=],
79998076 then return the result of
80008077 [=converted to an IDL value|converting=]
80018078 |V| to that type.
80028079 1. If |types| includes a [=numeric type=],
80038080 then return the result of [=converted to an IDL value|converting=]
80048081 |V| to that [=numeric type=].
8005- 1. If |types| includes a {{boolean}},
8082+ 1. If |types| includes {{boolean}},
80068083 then return the result of [=converted to an IDL value|converting=]
80078084 |V| to {{boolean}}.
8085+ 1. If |types| includes a {{bigint}},
8086+ then return the result of [=converted to an IDL value|converting=]
8087+ |V| to {{bigint}}.
80088088 1. [=ECMAScript/Throw=] a {{ECMAScript/TypeError}}.
80098089</div>
80108090
@@ -10592,6 +10672,16 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
1059210672
1059310673 then remove from |S| all other entries.
1059410674
10675+ 1. Otherwise: if <a abstract-op>Type</a>(|V|) is [=BigInt=]
10676+ and there is an entry in |S| that has one of the following types at position |i| of its type list,
10677+ * {{bigint}}
10678+ * a [=nullable type|nullable=] {{bigint}}
10679+ * an [=annotated type=] whose [=annotated types/inner type=] is one of the above types
10680+ * a [=union type=], [=nullable type|nullable=] union type, or [=annotated type|annotated=] union type
10681+ that has one of the above types in its [=flattened member types=]
10682+
10683+ then remove from |S| all other entries.
10684+
1059510685 1. Otherwise: if there is an entry in |S| that has one of the following types at position |i| of its type list,
1059610686 * a [=string type=]
1059710687 * a [=nullable type|nullable=] version of any of the above types
@@ -10619,6 +10709,15 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
1061910709
1062010710 then remove from |S| all other entries.
1062110711
10712+ 1. Otherwise: if there is an entry in |S| that has one of the following types at position |i| of its type list,
10713+ * {{bigint}}
10714+ * a [=nullable type|nullable=] {{bigint}}
10715+ * an [=annotated type=] whose [=annotated types/inner type=] is one of the above types
10716+ * a [=union type=], [=nullable type|nullable=] union type, or [=annotated type|annotated=] union type
10717+ that has one of the above types in its [=flattened member types=]
10718+
10719+ then remove from |S| all other entries.
10720+
1062210721 1. Otherwise: if there is an entry in |S| that has {{any}} at position |i|
1062310722 of its type list, then remove from |S| all other entries.
1062410723 1. Otherwise: [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
@@ -13568,6 +13667,11 @@ expression syntax [[!PERLRE]]) as follows:
1356813667 <td><code>=</code></td>
1356913668 <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>
1357013669 </tr>
13670+ <tr>
13671+ <td id="prod-bigint"><emu-t class="regex">bigint</emu-t></td>
13672+ <td><code>=</code></td>
13673+ <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>
13674+ </tr>
1357113675 <tr>
1357213676 <td id="prod-identifier"><emu-t class="regex">identifier</emu-t></td>
1357313677 <td><code>=</code></td>
0 commit comments