Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-243869.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-243869.js';
7 //-----------------------------------------------------------------------------
8 // testcase from Alex Vincent
9 var BUGNUMBER = 243869;
10 var summary = 'Rethrown custom Errors should retain file and line number';
11 var actual = '';
12 var expect = 'Test Location:123';
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 function bar()
18 {
19 try
20 {
21 var f = new Error("Test Error", "Test Location", 123);
22 throw f;
23 }
24 catch(e)
25 {
26 throw e;
27 }
28 }
29
30 try
31 {
32 bar();
33 }
34 catch(eb)
35 {
36 actual = eb.fileName + ':' + eb.lineNumber
37 }
38
39 reportCompare(expect, actual, summary);