js/src/tests/test262/ch09/9.3/S9.3_A4.2_T1.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  * Result of number conversion from number value equals to the input argument (no conversion)
     6  *
     7  * @path ch09/9.3/S9.3_A4.2_T1.js
     8  * @description Number.NaN, +0, -0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY,
     9  * Number.MAX_VALUE and Number.MIN_VALUE convert to Number by explicit transformation
    10  */
    12 // CHECK#1
    13 if (isNaN(Number(Number.NaN)) !== true) {
    14   $ERROR('#1: Number(NaN) === Not-a-Number. Actual: ' + (Number(NaN))); 
    15 }
    17 // CHECK#2
    18 if (Number(+0) !== +0) {
    19   $ERROR('#2.1: Number(+0) === 0. Actual: ' + (Number(+0))); 
    20 } else {
    21   if (1/Number(+0) !== Number.POSITIVE_INFINITY) {
    22     $ERROR('#2.2: Number(+0) === +0. Actual: -0');
    23   }	
    24 }
    26 // CHECK#3
    27 if (Number(-0) !== -0) {
    28   $ERROR('#3.1: Number(-0) === 0. Actual: ' + (Number(-0))); 
    29 } else {
    30   if (1/Number(-0) !== Number.NEGATIVE_INFINITY) {
    31     $ERROR('#3.2: Number(-0) === -0. Actual: +0');
    32   }	
    33 }
    35 // CHECK#4
    36 if (Number(Number.POSITIVE_INFINITY) !== Number.POSITIVE_INFINITY) {
    37   $ERROR('#4: Number(+Infinity) === +Infinity. Actual: ' + (Number(+Infinity))); 
    38 }
    40 // CHECK#5
    41 if (Number(Number.NEGATIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {
    42   $ERROR('#5: Number(-Infinity) === -Infinity. Actual: ' + (Number(-Infinity))); 
    43 }
    45 // CHECK#6
    46 if (Number(Number.MAX_VALUE) !== Number.MAX_VALUE) {
    47   $ERROR('#6: Number(Number.MAX_VALUE) === Number.MAX_VALUE. Actual: ' + (Number(Number.MAX_VALUE))); 
    48 }
    50 // CHECK#7
    51 if (Number(Number.MIN_VALUE) !== Number.MIN_VALUE) {
    52   $ERROR('#7: Number(Number.MIN_VALUE) === Number.MIN_VALUE. Actual: ' + (Number(Number.MIN_VALUE))); 
    53 }

mercurial