source: imaps-frontend/node_modules/es-abstract/2024/Number/sameValue.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 569 bytes
Line 
1'use strict';
2
3var isNegativeZero = require('math-intrinsics/isNegativeZero');
4var $TypeError = require('es-errors/type');
5
6var NumberSameValueZero = require('./sameValueZero');
7
8// https://262.ecma-international.org/11.0/#sec-numeric-types-number-sameValue
9
10module.exports = function NumberSameValue(x, y) {
11 if (typeof x !== 'number' || typeof y !== 'number') {
12 throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
13 }
14 if (x === 0 && y === 0) {
15 return !(isNegativeZero(x) ^ isNegativeZero(y));
16 }
17 return NumberSameValueZero(x, y);
18};
Note: See TracBrowser for help on using the repository browser.