Debian Codegraph @

js/src/tests/test262/language/statements/try/S12.14_A18_T3.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: Catching objects with try/catch/finally statement
6 es5id: 12.14_A18_T3
7 description: Catching boolean
8 ---*/
9
10 // CHECK#1
11 try{
12 throw true;
13 }
14 catch(e){
15 if (e!==true) throw new Test262Error('#1: Exception ===true. Actual: Exception ==='+ e );
16 }
17
18 // CHECK#2
19 try{
20 throw false;
21 }
22 catch(e){
23 if (e!==false) throw new Test262Error('#2: Exception ===false. Actual: Exception ==='+ e );
24 }
25
26 // CHECK#3
27 var b=false;
28 try{
29 throw b;
30 }
31 catch(e){
32 if (e!==false) throw new Test262Error('#3: Exception ===false. Actual: Exception ==='+ e );
33 }
34
35 // CHECK#4
36 var b=true;
37 try{
38 throw b;
39 }
40 catch(e){
41 if (e!==true) throw new Test262Error('#4: Exception ===true. Actual: Exception ==='+ e );
42 }
43
44 // CHECK#5
45 var b=true;
46 try{
47 throw b&&false;
48 }
49 catch(e){
50 if (e!==false) throw new Test262Error('#5: Exception ===false. Actual: Exception ==='+ e );
51 }
52
53 // CHECK#5
54 var b=true;
55 try{
56 throw b||false;
57 }
58 catch(e){
59 if (e!==true) throw new Test262Error('#6: Exception ===true. Actual: Exception ==='+ e );
60 }
61
62 reportCompare(0, 0);