Debian Codegraph @

rhino/testsrc/tests/js1_5/Exceptions/regress-257751.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-257751.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 257751;
9 var summary = 'RegExp Syntax Errors should have lineNumber and fileName';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 var status;
17 var re;
18
19 status = summary + ' ' + inSection(1) + ' RegExp("\\\\") ';
20 try
21 {
22 expect = 'Pass';
23 re = RegExp('\\');
24 }
25 catch(e)
26 {
27 if (e.fileName && e.lineNumber)
28 {
29 actual = 'Pass';
30 }
31 else
32 {
33 actual = 'Fail';
34 }
35 }
36 reportCompare(expect, actual, status);
37
38 status = summary + ' ' + inSection(2) + ' RegExp(")") ';
39 try
40 {
41 expect = 'Pass';
42 re = RegExp(')');
43 }
44 catch(e)
45 {
46 if (e.fileName && e.lineNumber)
47 {
48 actual = 'Pass';
49 }
50 else
51 {
52 actual = 'Fail';
53 }
54 }
55 reportCompare(expect, actual, status);
56
57 status = summary + ' ' + inSection(3) + ' /\\\\/ ';
58 try
59 {
60 expect = 'Pass';
61 re = eval('/\\/');
62 }
63 catch(e)
64 {
65 if (e.fileName && e.lineNumber)
66 {
67 actual = 'Pass';
68 }
69 else
70 {
71 actual = 'Fail';
72 }
73 }
74 reportCompare(expect, actual, status);
75
76 status = summary + ' ' + inSection(4) + ' /)/ ';
77 try
78 {
79 expect = 'Pass';
80 re = eval('/)/');
81 }
82 catch(e)
83 {
84 if (e.fileName && e.lineNumber)
85 {
86 actual = 'Pass';
87 }
88 else
89 {
90 actual = 'Fail';
91 }
92 }
93 reportCompare(expect, actual, status);