aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/08_Types/8.1_The_Undefined_Type/S8.1_A2_T1.js
blob: 8dd99f42f8ae404ef06eb93aa6860f93d6787d85 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S8.1_A2_T1;
 * @section: 8.1;
 * @assertion: Any variable that has not been assigned a value has the value undefined;
 * @description: Check that var x have value and type undefined; 
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S8.1_A2_T1",

path: "TestCases/08_Types/8.1_The_Undefined_Type/S8.1_A2_T1.js",

assertion: "Any variable that has not been assigned a value has the value undefined",

description: "Check that var x have value and type undefined",

test: function testcase() {
   var x;

///////////////////////////////////////////////////////////////////
// CHECK#1
if (!(x === undefined)) {
  $ERROR('#1: var x; x === undefined. Actual: ' + (x));
}
//
///////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////
// CHECK#2
if (!(typeof(x) === "undefined")) {
  $ERROR('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x)));
}
//
///////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////
// CHECK#3
if (!(x === void 0)) {
  $ERROR('#3: var x; x === void 0. Actual: ' + (x));
}
//
///////////////////////////////////////////////////////////////////

 }
});