Debian Codegraph @

rhino/testsrc/tests/js1_5/Exceptions/regress-347674.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-347674.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = "347674";
9 var summary = "ReferenceError thrown when accessing exception bound in a " +
10 "catch block in a try block within that catch block";
11 var actual, expect;
12
13 printBugNumber(BUGNUMBER);
14 printStatus(summary);
15
16 /**************
17 * BEGIN TEST *
18 **************/
19
20 var failed = false;
21
22 function foo()
23 {
24 try
25 {
26 throw "32.9";
27 }
28 catch (e)
29 {
30 try
31 {
32 var errorCode = /^(\d+)\s+.*$/.exec(e)[1];
33 }
34 catch (e2)
35 {
36 void("*** internal error: e == " + e + ", e2 == " + e2);
37 throw e2;
38 }
39 }
40 }
41
42 try
43 {
44 try
45 {
46 foo();
47 }
48 catch (ex)
49 {
50 if (!(ex instanceof TypeError))
51 throw "Wrong value thrown!\n" +
52 " expected: a TypeError ('32.9' doesn't match the regexp)\n" +
53 " actual: " + ex;
54 }
55 }
56 catch (e)
57 {
58 failed = e;
59 }
60
61 expect = false;
62 actual = failed;
63
64 reportCompare(expect, actual, summary);