|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
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.