summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch09/9.2/S9.2_A1_T2.js
blob: 0700b8da633831a08653c8b3c186ebdb0c592ffd (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
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * Result of boolean conversion from undefined value is false
 *
 * @path ch09/9.2/S9.2_A1_T2.js
 * @description Undefined, void and others are converted to Boolean by implicit transformation
 */

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

// CHECK#2
if (!(void 0) !== true) {
  $ERROR('#2: !(undefined) === true. Actual: ' + (!(undefined)));
}

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