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

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
RevLine 
[d565449]1'use strict';
2
[79a0317]3var callBound = require('call-bound');
[d565449]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') {
[79a0317]12 return value;
[d565449]13 }
[79a0317]14
[d565449]15 if (!$bigIntValueOf) {
16 throw new $SyntaxError('BigInt is not supported');
17 }
[79a0317]18
[d565449]19 return $bigIntValueOf(value);
20};
Note: See TracBrowser for help on using the repository browser.