main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
534 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/14.0/#sec-samevaluenonnumeric
|
---|
9 |
|
---|
10 | module.exports = function SameValueNonNumber(x, y) {
|
---|
11 | if (typeof x === 'number') {
|
---|
12 | throw new $TypeError('Assertion failed: SameValueNonNumber does not accept Number values');
|
---|
13 | }
|
---|
14 | if (Type(x) !== Type(y)) {
|
---|
15 | throw new $TypeError('SameValueNonNumber requires two non-Number values of the same type.');
|
---|
16 | }
|
---|
17 | return SameValue(x, y);
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.