Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-465862.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-465862.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 465862;
9 var summary = 'Do case-insensitive matching correctly in JIT for non-ASCII-letters';
10
11 var i = 0;
12 var status = '';
13 var statusmessages = new Array();
14 var pattern = '';
15 var patterns = new Array();
16 var string = '';
17 var strings = new Array();
18 var actualmatch = '';
19 var actualmatches = new Array();
20 var expectedmatch = '';
21 var expectedmatches = new Array();
22
23 // Note: we must call the RegExp constructor here instead of using
24 // literals. Otherwise, because the regexps are compiled at parse
25 // time, they will not be compiled to native code and we will not
26 // actually be testing jitted regexps.
27
28 jit(true);
29
30 status = inSection(1);
31 string = '@';
32 pattern = new RegExp('@', 'i');
33 actualmatch = string.match(pattern);
34 expectedmatch = Array(string);
35 addThis();
36
37 status = inSection(2);
38 string = '`';
39 pattern = new RegExp('`', 'i');
40 actualmatch = string.match(pattern);
41 expectedmatch = Array(string);
42 addThis();
43
44 status = inSection(3);
45 string = '@';
46 pattern = new RegExp('`', 'i');
47 actualmatch = string.match(pattern);
48 expectedmatch = null;
49 addThis();
50
51 status = inSection(4);
52 string = '`';
53 pattern = new RegExp('@', 'i');
54 print(string + ' ' + pattern);
55 actualmatch = string.match(pattern);
56 print('z ' + actualmatch);
57 print('`'.match(/@/i));
58 expectedmatch = null;
59 addThis();
60
61 jit(false);
62
63 //-----------------------------------------------------------------------------
64 test();
65 //-----------------------------------------------------------------------------
66
67 function addThis()
68 {
69 statusmessages[i] = status;
70 patterns[i] = pattern;
71 strings[i] = string;
72 actualmatches[i] = actualmatch;
73 expectedmatches[i] = expectedmatch;
74 i++;
75 }
76
77
78 function test()
79 {
80 enterFunc ('test');
81 printBugNumber(BUGNUMBER);
82 printStatus (summary);
83 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
84 exitFunc ('test');
85 }