Permalink
Cannot retrieve contributors at this time
21 lines (16 sloc)
635 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/es-abstract/2022/SameValueNonNumeric.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var GetIntrinsic = require('get-intrinsic'); | |
var $TypeError = GetIntrinsic('%TypeError%'); | |
var SameValue = require('./SameValue'); | |
var Type = require('./Type'); | |
// https://262.ecma-international.org/11.0/#sec-samevaluenonnumeric | |
module.exports = function SameValueNonNumeric(x, y) { | |
var xType = Type(x); | |
if (xType === 'Number' || xType === 'BigInt') { | |
throw new $TypeError('Assertion failed: SameValueNonNumeric does not accept Number or BigInt values'); | |
} | |
if (xType !== Type(y)) { | |
throw new $TypeError('SameValueNonNumeric requires two non-numeric values of the same type.'); | |
} | |
return SameValue(x, y); | |
}; |