Debian Codegraph @

rhino/testsrc/tests/js1_5/Exceptions/catchguard-002-n.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 var gTestfile = 'catchguard-002-n.js';
8
9 DESCRIPTION = "var in catch clause should have caused an error.";
10 EXPECTED = "error";
11
12 var expect;
13 var actual;
14
15 test();
16
17 function test()
18 {
19 enterFunc ("test");
20
21 var EXCEPTION_DATA = "String exception";
22 var e;
23
24 printStatus ("Catchguard var declaration negative test.");
25
26 try
27 {
28 throw EXCEPTION_DATA;
29 }
30 catch (var e)
31 {
32 actual = e + '';
33 }
34
35 reportCompare(expect, actual, DESCRIPTION);
36
37 exitFunc ("test");
38 }