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.3.js (1168B)


      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.3
      7 description: Type(x) and Type(y) vary between primitive string and String object
      8 ---*/
      9 
     10 var x;
     11 
     12 //CHECK#1
     13 x = "1";
     14 x &= "1";
     15 if (x !== 1) {
     16  throw new Test262Error('#1: x = "1"; x &= "1"; x === 1. Actual: ' + (x));
     17 }
     18 
     19 //CHECK#2
     20 x = new String("1");
     21 x &= "1";
     22 if (x !== 1) {
     23  throw new Test262Error('#2: x = new String("1"); x &= "1"; x === 1. Actual: ' + (x));
     24 }
     25 
     26 //CHECK#3
     27 x = "1";
     28 x &= new String("1");
     29 if (x !== 1) {
     30  throw new Test262Error('#3: x = "1"; x &= new String("1"); x === 1. Actual: ' + (x));
     31 }
     32 
     33 //CHECK#4
     34 x = new String("1");
     35 x &= new String("1");
     36 if (x !== 1) {
     37  throw new Test262Error('#4: x = new String("1"); x &= new String("1"); x === 1. Actual: ' + (x));
     38 }
     39 
     40 //CHECK#5
     41 x = "x";
     42 x &= "1";
     43 if (x !== 0) {
     44  throw new Test262Error('#5: x = "x"; x &= "1"; x === 0. Actual: ' + (x));
     45 }
     46 
     47 //CHECK#6
     48 x = "1";
     49 x &= "x";
     50 if (x !== 0) {
     51  throw new Test262Error('#6: x = "1"; x &= "x"; x === 0. Actual: ' + (x));
     52 }
     53 
     54 reportCompare(0, 0);