tor-browser

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

S11.6.2_A3_T1.1.js (953B)


      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: Operator x - y returns ToNumber(x) - ToNumber(y)
      6 es5id: 11.6.2_A3_T1.1
      7 description: >
      8    Type(x) and Type(y) vary between primitive boolean and Boolean
      9    object
     10 ---*/
     11 
     12 //CHECK#1
     13 if (true - true !== 0) {
     14  throw new Test262Error('#1: true - true === 0. Actual: ' + (true - true));
     15 }
     16 
     17 //CHECK#2
     18 if (new Boolean(true) - true !== 0) {
     19  throw new Test262Error('#2: new Boolean(true) - true === 0. Actual: ' + (new Boolean(true) - true));
     20 }
     21 
     22 //CHECK#3
     23 if (true - new Boolean(true) !== 0) {
     24  throw new Test262Error('#3: true - new Boolean(true) === 0. Actual: ' + (true - new Boolean(true)));
     25 }
     26 
     27 //CHECK#4
     28 if (new Boolean(true) - new Boolean(true) !== 0) {
     29  throw new Test262Error('#4: new Boolean(true) - new Boolean(true) === 0. Actual: ' + (new Boolean(true) - new Boolean(true)));
     30 }
     31 
     32 reportCompare(0, 0);