Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-230216-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-230216-3.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 230216;
9 var summary = 'check for numerical overflow in regexps in back reference and bounds for {} quantifier';
10 var actual = '';
11 var expect = '';
12 var status = '';
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 status = inSection(1) + ' /((\3|b)\2(a)x)+/.exec("aaxabxbaxbbx") ';
18
19 actual = 'undefined';
20 expect = ['ax', 'ax', '', 'a'] + '';
21
22 try
23 {
24 actual = /((\3|b)\2(a)x)+/.exec("aaxabxbaxbbx") + '';
25 }
26 catch(e)
27 {
28 status += ' Error: ' + e;
29 }
30
31 reportCompare(expect, actual, status);
32
33 status = inSection(2) + ' eval(\'/((\3|b)\2(a)x)+/.exec("aaxabxbaxbbx")\' ';
34
35 actual = 'undefined';
36 expect = ['ax', 'ax', '', 'a'] + '';
37
38 try
39 {
40 actual = eval('/((\\3|b)\\2(a)x)+/.exec("aaxabxbaxbbx")') + '';
41 }
42 catch(e)
43 {
44 status += ' Error: ' + e;
45 }
46
47 reportCompare(expect, actual, status);