web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
551 B

  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var callBound = require('call-bind/callBound');
  4. var $TypeError = GetIntrinsic('%TypeError%');
  5. var $bigIntValueOf = callBound('BigInt.prototype.valueOf', true);
  6. var Type = require('./Type');
  7. // https://262.ecma-international.org/11.0/#sec-thisbigintvalue
  8. module.exports = function thisBigIntValue(value) {
  9. var type = Type(value);
  10. if (type === 'BigInt') {
  11. return value;
  12. }
  13. if (!$bigIntValueOf) {
  14. throw new $TypeError('BigInt is not supported');
  15. }
  16. return $bigIntValueOf(value);
  17. };