main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
423 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | var toPrimitive = require('../internals/to-primitive');
|
---|
| 3 |
|
---|
| 4 | var $TypeError = TypeError;
|
---|
| 5 |
|
---|
| 6 | // `ToBigInt` abstract operation
|
---|
| 7 | // https://tc39.es/ecma262/#sec-tobigint
|
---|
| 8 | module.exports = function (argument) {
|
---|
| 9 | var prim = toPrimitive(argument, 'number');
|
---|
| 10 | if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
|
---|
| 11 | // eslint-disable-next-line es/no-bigint -- safe
|
---|
| 12 | return BigInt(prim);
|
---|
| 13 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.