source: imaps-frontend/node_modules/es-abstract/2022/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: 510 bytes
Line 
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
8var Type = require('./Type');
9
10// https://262.ecma-international.org/11.0/#sec-thisbigintvalue
11
12module.exports = function thisBigIntValue(value) {
13 var type = Type(value);
14 if (type === 'BigInt') {
15 return value;
16 }
17 if (!$bigIntValueOf) {
18 throw new $SyntaxError('BigInt is not supported');
19 }
20 return $bigIntValueOf(value);
21};
Note: See TracBrowser for help on using the repository browser.