blob: 4d11746489890c34341d0efa0721bb0ff6a8695b (
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
|
// 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.2_A1_T3;
* @section: 15.1.2.2, 9.8;
* @assertion: Operator use ToString;
* @description: Checking for undefined and null;
*/
//CHECK#1
if (!(isNaN(parseInt(undefined)) && isNaN(parseInt("NaN")))) {
$ERROR('#1: parseInt(undefined) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN")));
}
//CHECK#2
if (!(isNaN(parseInt(null)) && isNaN(parseInt("NaN")))) {
$ERROR('#2: parseInt(null) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN")));
}
//CHECK#3
if (String(parseInt(undefined)) !== "NaN") {
$ERROR('#3: String(parseInt(undefined)) === "NaN". Actual: ' + (String(parseInt(undefined))));
}
//CHECK#4
if (String(parseInt(null)) !== "NaN") {
$ERROR('#4: String(parseInt(null)) === "NaN". Actual: ' + (String(parseInt(null))));
}
|