|
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 * Any variable that has not been assigned a value has the value undefined |
|
6 * |
|
7 * @path ch08/8.1/S8.1_A2_T2.js |
|
8 * @description Function return undefined |
|
9 */ |
|
10 |
|
11 // CHECK#1 |
|
12 function test1(x) { |
|
13 return x; |
|
14 } |
|
15 |
|
16 if (!(test1() === void 0)) { |
|
17 $ERROR('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1())); |
|
18 } |
|
19 |
|
20 // CHECK#2 |
|
21 function test2() { |
|
22 } |
|
23 |
|
24 if (!(test2() === void 0)) { |
|
25 $ERROR('#2: function test2(){} test2() === void 0. Actual: ' + (test2())); |
|
26 } |
|
27 |