tor-browser

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

S11.6.1_A3.1_T1.3.js (1015B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
      7    then operator x + y returns ToNumber(x) + ToNumber(y)
      8 es5id: 11.6.1_A3.1_T1.3
      9 description: >
     10    Type(Primitive(x)) and Type(Primitive(y)) vary between Null and
     11    Undefined
     12 ---*/
     13 
     14 //CHECK#1
     15 if (isNaN(null + undefined) !== true) {
     16  throw new Test262Error('#1: null + undefined === Not-a-Number. Actual: ' + (null + undefined));
     17 }
     18 
     19 //CHECK#2
     20 if (isNaN(undefined + null) !== true) {
     21  throw new Test262Error('#2: undefined + null === Not-a-Number. Actual: ' + (undefined + null));
     22 }
     23 
     24 //CHECK#3
     25 if (isNaN(undefined + undefined) !== true) {
     26  throw new Test262Error('#3: undefined + undefined === Not-a-Number. Actual: ' + (undefined + undefined));
     27 }
     28 
     29 //CHECK#4
     30 if (null + null !== 0) {
     31  throw new Test262Error('#4: null + null === 0. Actual: ' + (null + null));
     32 }
     33 
     34 reportCompare(0, 0);