| 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: The initial value of Infinity is Number.POSITIVE_INFINITY |
| 6 |
es5id: 15.1.1.2_A1 |
| 7 |
description: Use typeof, isNaN, isFinite |
| 8 |
---*/ |
| 9 |
|
| 10 |
// CHECK#1 |
| 11 |
if (typeof(Infinity) !== "number") { |
| 12 |
$ERROR('#1: typeof(Infinity) === "number". Actual: ' + (typeof(Infinity))); |
| 13 |
} |
| 14 |
|
| 15 |
// CHECK#2 |
| 16 |
if (isFinite(Infinity) !== false) { |
| 17 |
$ERROR('#2: Infinity === Not-a-Finite. Actual: ' + (Infinity)); |
| 18 |
} |
| 19 |
|
| 20 |
// CHECK#3 |
| 21 |
if (isNaN(Infinity) !== false) { |
| 22 |
$ERROR('#3: Infinity === Not-a-Number. Actual: ' + (Infinity)); |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
// CHECK#4 |
| 27 |
if (Infinity !== Number.POSITIVE_INFINITY) { |
| 28 |
$ERROR('#4: Infinity === Number.POSITIVE_INFINITY. Actual: ' + (Infinity)); |
| 29 |
} |