Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/logical-not/S9.2_A1_T2.js

raw
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 info: Result of boolean conversion from undefined value is false
6 es5id: 9.2_A1_T2
7 description: >
8 Undefined, void and others are converted to Boolean by implicit
9 transformation
10 ---*/
11
12 // CHECK#1
13 if (!(undefined) !== true) {
14 $ERROR('#1: !(undefined) === true. Actual: ' + (!(undefined)));
15 }
16
17 // CHECK#2
18 if (!(void 0) !== true) {
19 $ERROR('#2: !(undefined) === true. Actual: ' + (!(undefined)));
20 }
21
22 // CHECK#3
23 if (!(eval("var x")) !== true) {
24 $ERROR('#3: !(eval("var x")) === true. Actual: ' + (!(eval("var x"))));
25 }