Debian Codegraph @

js/src/tests/test262/language/statements/throw/S12.13_A2_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: |
6 "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1
7 evaluates Expression
8 es5id: 12.13_A2_T4
9 description: Throwing string
10 ---*/
11
12 // CHECK#1
13 try{
14 throw "exception #1";
15 }
16 catch(e){
17 if (e!=="exception #1") throw new Test262Error('#1: Exception ==="exception #1". Actual: Exception ==='+ e );
18 }
19
20 // CHECK#2
21 var b="exception #1";
22 try{
23 throw b;
24 }
25 catch(e){
26 if (e!=="exception #1") throw new Test262Error('#2: Exception ==="exception #1". Actual: Exception ==='+ e );
27 }
28
29 reportCompare(0, 0);