main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
472 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var callBound = require('call-bind/callBound');
|
---|
| 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; // step 1
|
---|
| 13 | }
|
---|
| 14 | if (!$bigIntValueOf) {
|
---|
| 15 | throw new $SyntaxError('BigInt is not supported');
|
---|
| 16 | }
|
---|
| 17 | return $bigIntValueOf(value);
|
---|
| 18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.