Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-76683.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 /*
7 * Date: 01 May 2001
8 *
9 * SUMMARY: Regression test for Bugzilla bug 76683 on Rhino:
10 * "RegExp regression (NullPointerException)"
11 *
12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=76683
13 */
14 //-----------------------------------------------------------------------------
15 var gTestfile = 'regress-76683.js';
16 var i = 0;
17 var BUGNUMBER = 76683;
18 var summary = 'Regression test for Bugzilla bug 76683';
19 var status = '';
20 var statusmessages = new Array();
21 var pattern = '';
22 var patterns = new Array();
23 var string = '';
24 var strings = new Array();
25 var actualmatch = '';
26 var actualmatches = new Array();
27 var expectedmatch = '';
28 var expectedmatches = new Array();
29
30
31 /*
32 * Rhino (2001-04-19) crashed on the 3rd regular expression below.
33 * It didn't matter what the string was. No problem in SpiderMonkey -
34 */
35 string = 'abc';
36 status = inSection(1);
37 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<([\$\w:\.\-]+)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/;
38 actualmatch = string.match(pattern);
39 expectedmatch = null;
40 addThis();
41
42 status = inSection(2);
43 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/;
44 actualmatch = string.match(pattern);
45 expectedmatch = null;
46 addThis();
47
48 // This was the one causing a Rhino crash -
49 status = inSection(3);
50 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))|(<\/tagPattern[^>]*>)/;
51 actualmatch = string.match(pattern);
52 expectedmatch = null;
53 addThis();
54
55
56
57 //-------------------------------------------------------------------------------------------------
58 test();
59 //-------------------------------------------------------------------------------------------------
60
61
62
63 function addThis()
64 {
65 statusmessages[i] = status;
66 patterns[i] = pattern;
67 strings[i] = string;
68 actualmatches[i] = actualmatch;
69 expectedmatches[i] = expectedmatch;
70 i++;
71 }
72
73
74 function test()
75 {
76 enterFunc ('test');
77 printBugNumber(BUGNUMBER);
78 printStatus (summary);
79 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
80 exitFunc ('test');
81 }