source: imaps-frontend/node_modules/es-abstract/2024/ThisBigIntValue.js

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
RevLine 
[d565449]1'use strict';
2
3var callBound = require('call-bind/callBound');
4
5var $SyntaxError = require('es-errors/syntax');
6var $bigIntValueOf = callBound('BigInt.prototype.valueOf', true);
7
8// https://262.ecma-international.org/15.0/#sec-thisbigintvalue
9
10module.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.