Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-280769-3.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-280769-3.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 280769;
9 var summary = 'Do not crash on overflow of 64K boundary in number of classes in regexp';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 var N = 100 * 1000;
17
18 status = summary + ' ' + inSection(3) + ' (new RegExp("[0][1]...[99999]").exec("") ';
19
20 var a = new Array(N);
21
22 for (var i = 0; i != N; ++i) {
23 a[i] = i;
24 }
25
26 var str = '['+a.join('][')+']'; // str is [0][1][2]...[<PRINTED N-1>]
27
28 try
29 {
30 var re = new RegExp(str);
31 }
32 catch(e)
33 {
34 printStatus('Exception creating RegExp: ' + e);
35 }
36
37 try
38 {
39 re.exec('');
40 }
41 catch(e)
42 {
43 printStatus('Exception executing RegExp: ' + e);
44 }
45
46 reportCompare(expect, actual, status);