tor-browser

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

S9.5_A2.2_T1.js (1945B)


      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: Compute result modulo 2^32
      6 es5id: 9.5_A2.2_T1
      7 description: Use operator <<0
      8 ---*/
      9 
     10 // CHECK#1
     11 if ((-2147483647 << 0) !== -2147483647) {
     12  throw new Test262Error('#1: (-2147483647 << 0) === -2147483647. Actual: ' + ((-2147483647 << 0)));
     13 }
     14 
     15 // CHECK#2
     16 if ((-2147483648 << 0) !== -2147483648) {
     17  throw new Test262Error('#2: (-2147483648 << 0) === -2147483648. Actual: ' + ((-2147483648 << 0)));
     18 }
     19 
     20 // CHECK#3
     21 if ((-2147483649 << 0) !== 2147483647) {
     22  throw new Test262Error('#3: (-2147483649 << 0) === 2147483647. Actual: ' + ((-2147483649 << 0)));
     23 }
     24 
     25 // CHECK#4
     26 if ((4294967295 << 0) !== -1) {
     27  throw new Test262Error('#4: (4294967295 << 0) === -1. Actual: ' + ((4294967295 << 0)));
     28 }
     29 
     30 // CHECK#5
     31 if ((4294967296 << 0) !== 0) {
     32  throw new Test262Error('#5: (4294967296 << 0) === 0. Actual: ' + ((4294967296 << 0)));
     33 }
     34 
     35 // CHECK#6
     36 if ((4294967297 << 0) !== 1) {
     37  throw new Test262Error('#6: (4294967297 << 0) === 1. Actual: ' + ((4294967297 << 0)));
     38 }
     39 
     40 // CHECK#7
     41 if ((-4294967295 << 0) !== 1) {
     42  throw new Test262Error('#7: (-4294967295 << 0) === 1. Actual: ' + ((-4294967295 << 0)));
     43 }
     44 
     45 // CHECK#8
     46 if ((-4294967296 << 0) !== 0) {
     47  throw new Test262Error('#8: (-4294967296 << 0) === 0. Actual: ' + ((-4294967296 << 0)));
     48 }
     49 
     50 // CHECK#9
     51 if ((-4294967297 << 0) !== -1) {
     52  throw new Test262Error('#9: (-4294967297 << 0) === -1. Actual: ' + ((-4294967297 << 0)));
     53 }
     54 
     55 // CHECK#10
     56 if ((8589934591 << 0) !== -1) {
     57  throw new Test262Error('#10: (8589934591 << 0) === -1. Actual: ' + ((8589934591 << 0)));
     58 }
     59 
     60 // CHECK#11
     61 if ((8589934592 << 0) !== 0) {
     62  throw new Test262Error('#11: (8589934592 << 0) === 0. Actual: ' + ((8589934592 << 0)));
     63 }
     64 
     65 // CHECK#12
     66 if ((8589934593 << 0) !== 1) {
     67  throw new Test262Error('#12: (8589934593 << 0) === 1. Actual: ' + ((8589934593 << 0)));
     68 }
     69 
     70 reportCompare(0, 0);