main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
455 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var callBound = require('call-bound');
|
---|
4 |
|
---|
5 | var $SyntaxError = require('es-errors/syntax');
|
---|
6 | var $bigIntValueOf = callBound('BigInt.prototype.valueOf', true);
|
---|
7 |
|
---|
8 | // https://262.ecma-international.org/15.0/#sec-thisbigintvalue
|
---|
9 |
|
---|
10 | module.exports = function ThisBigIntValue(value) {
|
---|
11 | if (typeof value === 'bigint') {
|
---|
12 | return value;
|
---|
13 | }
|
---|
14 |
|
---|
15 | if (!$bigIntValueOf) {
|
---|
16 | throw new $SyntaxError('BigInt is not supported');
|
---|
17 | }
|
---|
18 |
|
---|
19 | return $bigIntValueOf(value);
|
---|
20 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.