This commit is contained in:
szabomarton
2025-01-28 11:38:27 +01:00
parent 9c5ca86086
commit 7f4a15b9c3
36841 changed files with 4032468 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
'use strict';
var $TypeError = require('es-errors/type');
var SameValue = require('./SameValue');
var Type = require('./Type');
// https://262.ecma-international.org/14.0/#sec-samevaluenonnumeric
module.exports = function SameValueNonNumber(x, y) {
if (typeof x === 'number') {
throw new $TypeError('Assertion failed: SameValueNonNumber does not accept Number values');
}
if (Type(x) !== Type(y)) {
throw new $TypeError('SameValueNonNumber requires two non-Number values of the same type.');
}
return SameValue(x, y);
};