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
|
Rev | Line | |
---|
[d565449] | 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) {
|
---|
[79a0317] | 11 | if (typeof x === 'number') {
|
---|
[d565449] | 12 | throw new $TypeError('Assertion failed: SameValueNonNumber does not accept Number values');
|
---|
| 13 | }
|
---|
[79a0317] | 14 | if (Type(x) !== Type(y)) {
|
---|
[d565449] | 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.