js/src/tests/test262/ch11/11.4/11.4.7/S11.4.7_A4.2.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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  * Negating +0 produces -0, negating -0 produces +0
     6  *
     7  * @path ch11/11.4/11.4.7/S11.4.7_A4.2.js
     8  * @description Checking Infinity
     9  */
    11 //CHECK#1
    12 var x = 0; 
    13 x = -x;
    14 if (x !== -0) {
    15   $ERROR('#1.1: var x = 0; x = -x; x === 0. Actual: ' + (x));
    16 } else {
    17   if (1/x !== Number.NEGATIVE_INFINITY) {
    18     $ERROR('#1.2: var x = 0; x = -x; x === - 0. Actual: +0');
    19   }
    20 }
    22 //CHECK#2
    23 var x = -0; 
    24 x = -x;
    25 if (x !== 0) {
    26   $ERROR('#2.1: var x = -0; x = -x; x === 0. Actual: ' + (x));
    27 } else {
    28   if (1/x !== Number.POSITIVE_INFINITY) {
    29     $ERROR('#2.2: var x = -0; x = -x; x === + 0. Actual: -0');
    30   }
    31 }

mercurial