main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
423 bytes
|
Line | |
---|
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.