Debian Codegraph @

js/src/tests/test262/language/statements/try/S12.14_A18_T4.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_T4
7 description: Catching string
8 ---*/
9
10 // CHECK#1
11 try{
12 throw "exception #1";
13 }
14 catch(e){
15 if (e!=="exception #1") throw new Test262Error('#1: Exception ==="exception #1". Actual: Exception ==='+ e );
16 }
17
18 // CHECK#2
19 try{
20 throw "exception"+" #1";
21 }
22 catch(e){
23 if (e!=="exception #1") throw new Test262Error('#2: Exception ==="exception #1". Actual: Exception ==='+ e );
24 }
25
26 // CHECK#3
27 var b="exception #1";
28 try{
29 throw b;
30 }
31 catch(e){
32 if (e!=="exception #1") throw new Test262Error('#3: Exception ==="exception #1". Actual: Exception ==='+ e );
33 }
34
35 // CHECK#4
36 var a="exception";
37 var b=" #1";
38 try{
39 throw a+b;
40 }
41 catch(e){
42 if (e!=="exception #1") throw new Test262Error('#4: Exception ==="exception #1". Actual: Exception ==='+ e );
43 }
44
45 reportCompare(0, 0);