Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-375711.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-375711.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 375711;
9 var summary = 'Do not assert with /[Q-b]/i.exec("")';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 var s;
25
26 // see bug 416933
27 print('see bug 416933 for changed behavior on Gecko 1.9');
28
29 try
30 {
31 s = '/[Q-b]/.exec("")';
32 expect = 'No Error';
33 print(s + ' expect ' + expect);
34 eval(s);
35 actual = 'No Error';
36 }
37 catch(ex)
38 {
39 actual = ex + '';
40 }
41 reportCompare(expect, actual, summary + ': ' + s);
42
43 try
44 {
45 s ='/[Q-b]/i.exec("")';
46 expect = 'No Error';
47 print(s + ' expect ' + expect);
48 eval(s);
49 actual = 'No Error';
50 }
51 catch(ex)
52 {
53 actual = ex + '';
54 }
55 reportCompare(expect, actual, summary + ': ' + s);
56
57 try
58 {
59 s = '/[q-b]/.exec("")';
60 expect = 'SyntaxError: invalid range in character class';
61 print(s + ' expect ' + expect);
62 eval(s);
63 actual = 'No Error';
64 }
65 catch(ex)
66 {
67 actual = ex + '';
68 }
69 reportCompare(expect, actual, summary + ': ' + s);
70
71 try
72 {
73 s ='/[q-b]/i.exec("")';
74 expect = 'SyntaxError: invalid range in character class';
75 print(s + ' expect ' + expect);
76 eval(s);
77 actual = 'No Error';
78 }
79 catch(ex)
80 {
81 actual = ex + '';
82 }
83 reportCompare(expect, actual, summary + ': ' + s);
84
85 exitFunc ('test');
86 }