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.

21 lines
635 B

  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. var SameValue = require('./SameValue');
  5. var Type = require('./Type');
  6. // https://262.ecma-international.org/11.0/#sec-samevaluenonnumeric
  7. module.exports = function SameValueNonNumeric(x, y) {
  8. var xType = Type(x);
  9. if (xType === 'Number' || xType === 'Bigint') {
  10. throw new $TypeError('Assertion failed: SameValueNonNumeric does not accept Number or BigInt values');
  11. }
  12. if (xType !== Type(y)) {
  13. throw new $TypeError('SameValueNonNumeric requires two non-numeric values of the same type.');
  14. }
  15. return SameValue(x, y);
  16. };