You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SameValue.js 316B

12345678910111213
  1. 'use strict';
  2. var $isNaN = require('../helpers/isNaN');
  3. // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
  4. module.exports = function SameValue(x, y) {
  5. if (x === y) { // 0 === -0, but they are not identical.
  6. if (x === 0) { return 1 / x === 1 / y; }
  7. return true;
  8. }
  9. return $isNaN(x) && $isNaN(y);
  10. };