Debian Codegraph @

rhino/testsrc/tests/js1_5/Exceptions/regress-273931.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-273931.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 273931;
9 var summary = 'Pop scope chain in exception handling';
10 var actual = '';
11 var expect = 'ReferenceError';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 status = summary + ' ' + inSection(1) + ' ';
17 try
18 {
19 with ({foo:"bar"})
20 throw 42;
21 }
22 catch (e)
23 {
24 try
25 {
26 printStatus(foo);
27 }
28 catch(ee)
29 {
30 actual = ee.name;
31 }
32 }
33
34 reportCompare(expect, actual, status);
35
36 status = summary + ' ' + inSection(2) + ' ';
37 try
38 {
39 with ({foo:"bar"})
40 eval("throw 42");
41 }
42 catch (e)
43 {
44 try
45 {
46 printStatus(foo);
47 }
48 catch(ee)
49 {
50 actual = ee.name;
51 }
52 }
53
54 reportCompare(expect, actual, status);
55
56 status = summary + ' ' + inSection(3) + ' ';
57 try
58 {
59 var s = "throw 42";
60 with ({foo:"bar"})
61 eval(s);
62 }
63 catch (e)
64 {
65 try
66 {
67 printStatus(foo);
68 }
69 catch(ee)
70 {
71 actual = ee.name;
72 }
73 }
74
75 reportCompare(expect, actual, status);