main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
573 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var SameValue = require('./SameValue');
|
---|
6 | var Type = require('./Type');
|
---|
7 |
|
---|
8 | // https://262.ecma-international.org/11.0/#sec-samevaluenonnumeric
|
---|
9 |
|
---|
10 | module.exports = function SameValueNonNumeric(x, y) {
|
---|
11 | if (typeof x === 'number' || typeof x === 'bigint') {
|
---|
12 | throw new $TypeError('Assertion failed: SameValueNonNumeric does not accept Number or BigInt values');
|
---|
13 | }
|
---|
14 | if (Type(x) !== Type(y)) {
|
---|
15 | throw new $TypeError('SameValueNonNumeric requires two non-numeric values of the same type.');
|
---|
16 | }
|
---|
17 | return SameValue(x, y);
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.