js/src/tests/test262/ch09/9.5/S9.5_A2.3_T2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * If result is greater than or equal to 2^31, return result -2^32
     6  *
     7  * @path ch09/9.5/S9.5_A2.3_T2.js
     8  * @description Use operator ~
     9  */
    11 // CHECK#1
    12 if (~2147483647 !== -2147483648) {
    13   $ERROR('#1: ~2147483647 ==== -2147483648)');
    14 }
    16 // CHECK#2
    17 if (~2147483648 !== ~-2147483648) {
    18   $ERROR('#2: ~2147483648 ==== ~-2147483648)');
    19 }
    21 // CHECK#3
    22 if (~2147483649 !== ~-2147483647) {
    23   $ERROR('#3: ~2147483649 ==== ~-2147483647)');
    24 }
    26 // CHECK#4
    27 if (~4294967295 !== ~-1) {
    28   $ERROR('#4: ~4294967295 ==== ~-1)');
    29 }
    31 // CHECK#5
    32 if (~4294967296 !== ~0) {
    33   $ERROR('#5: ~4294967296 ==== ~0)');
    34 }
    36 // CHECK#6
    37 if (~4294967297 !== ~1) {
    38   $ERROR('#6: ~4294967297 ==== ~1)');
    39 }

mercurial