tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

not-same-value-x-y-number.js (860B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 19.1.2.10
      5 description: >
      6    Object.is ( value1, value2 )
      7 
      8    ...
      9    6. If Type(x) is Number, then
     10      a. If x is NaN and y is NaN, return true.
     11      b. If x is +0 and y is -0, return false.
     12      c. If x is -0 and y is +0, return false.
     13      d. If x is the same Number value as y, return true.
     14      e. Return false.
     15    ...
     16 ---*/
     17 
     18 assert.sameValue(Object.is(+0, -0), false, "`Object.is(+0, -0)` returns `false`");
     19 assert.sameValue(Object.is(-0, +0), false, "`Object.is(-0, +0)` returns `false`");
     20 assert.sameValue(Object.is(0), false, "`Object.is(0)` returns `false`");
     21 assert.sameValue(Object.is(Infinity, -Infinity), false, "`Object.is(Infinity, -Infinity)` returns `false`");
     22 
     23 reportCompare(0, 0);