SameValueNonNumber.js 402 B

1234567891011121314
  1. 'use strict';
  2. var $TypeError = require('es-errors/type');
  3. var SameValue = require('./SameValue');
  4. // https://262.ecma-international.org/7.0/#sec-samevaluenonnumber
  5. module.exports = function SameValueNonNumber(x, y) {
  6. if (typeof x === 'number' || typeof x !== typeof y) {
  7. throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.');
  8. }
  9. return SameValue(x, y);
  10. };