SameValue.js 307 B

12345678910111213
  1. 'use strict';
  2. var $isNaN = require('../helpers/isNaN');
  3. // http://262.ecma-international.org/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. };