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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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