summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T2.js
blob: 71751eb6c93cdf530e0918565d7fb43362e41415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S15.1.2.5_A1_T2;
 * @section: 15.1.2.5;
 * @assertion: isFinite applies ToNumber to its argument, then return false if the result is NaN, +Infinity, -Infinity, and otherwise return true;
 * @description: Checking all object;
*/

// CHECK#1
if (!(isFinite({}) === false)) {
  $ERROR('#1: {} === Not-a-Finite. Actual: ' + ({})); 
}

// CHECK#2
if (!(isFinite(new String("string")) === false)) {
  $ERROR('#2: new String("string") === Not-a-Finite. Actual: ' + (new String("string"))); 
}

// CHECK#3
if (isFinite(new String("1")) === false) {
  $ERROR('#3: new String("1") === Not-a-Finite. Actual: ' + (new String("1"))); 
}

// CHECK#4
if (isFinite(new Number(1)) === false) {
  $ERROR('#4: new Number(1) !== Not-a-Finite'); 
}

// CHECK#5
if (!(isFinite(new Number(NaN)) === false)) {
  $ERROR('#5: new Number(NaN) === Not-a-Finite. Actual: ' + (new Number(NaN))); 
}

// CHECK#6
if (isFinite(new Boolean(true)) === false) {
  $ERROR('#6: new Boolean(true) !== Not-a-Finite'); 
}