sameValueZero.js 409 B

123456789101112131415
  1. 'use strict';
  2. var $TypeError = require('es-errors/type');
  3. var BigIntEqual = require('./equal');
  4. // https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-sameValueZero
  5. module.exports = function BigIntSameValueZero(x, y) {
  6. if (typeof x !== 'bigint' || typeof y !== 'bigint') {
  7. throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
  8. }
  9. return BigIntEqual(x, y);
  10. };