Debian Codegraph @

js/src/tests/test262/language/statements/if/S12.5_A1_T1.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: 1, true, non-empty string in expression is evaluated to true
6 es5id: 12.5_A1_T1
7 description: Using "if" without "else" construction
8 ---*/
9
10 //////////////////////////////////////////////////////////////////////////////
11 //CHECK#1
12 if(!(1))
13 throw new Test262Error('#1: 1 in expression is evaluated to true');
14 //
15 //////////////////////////////////////////////////////////////////////////////
16
17 //////////////////////////////////////////////////////////////////////////////
18 //CHECK#2
19 if(!(true))
20 throw new Test262Error('#2: true in expression is evaluated to true');
21 //
22 //////////////////////////////////////////////////////////////////////////////
23
24 //////////////////////////////////////////////////////////////////////////////
25 //CHECK#3
26 if(!("1"))
27 throw new Test262Error('#3: "1" in expression is evaluated to true');
28 //
29 //////////////////////////////////////////////////////////////////////////////
30
31 //////////////////////////////////////////////////////////////////////////////
32 //CHECK#4
33 if(!("A"))
34 throw new Test262Error('#4: "A" in expression is evaluated to true');
35 //
36 //////////////////////////////////////////////////////////////////////////////
37
38 reportCompare(0, 0);