tor-browser

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

S11.13.2_A4.9_T1.1.js (958B)


      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: The production x &= y is the same as x = x & y
      6 es5id: 11.13.2_A4.9_T1.1
      7 description: >
      8    Type(x) and Type(y) vary between primitive boolean and Boolean
      9    object
     10 ---*/
     11 
     12 var x;
     13 
     14 //CHECK#1
     15 x = true;
     16 x &= true;
     17 if (x !== 1) {
     18  throw new Test262Error('#1: x = true; x &= true; x === 1. Actual: ' + (x));
     19 }
     20 
     21 //CHECK#2
     22 x = new Boolean(true);
     23 x &= true;
     24 if (x !== 1) {
     25  throw new Test262Error('#2: x = new Boolean(true); x &= true; x === 1. Actual: ' + (x));
     26 }
     27 
     28 //CHECK#3
     29 x = true;
     30 x &= new Boolean(true);
     31 if (x !== 1) {
     32  throw new Test262Error('#3: x = true; x &= new Boolean(true); x === 1. Actual: ' + (x));
     33 }
     34 
     35 //CHECK#4
     36 x = new Boolean(true);
     37 x &= new Boolean(true);
     38 if (x !== 1) {
     39  throw new Test262Error('#4: x = new Boolean(true); x &= new Boolean(true); x === 1. Actual: ' + (x));
     40 }
     41 
     42 reportCompare(0, 0);