Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 var gTestfile = 'regress-429241.js';
6 var BUGNUMBER = 429241;
7 var summary = '\\x or \\u followed by too few hex digits';
8 var r;
10 reportCompare(
11 "x",
12 (r = /[\x]+/.exec("\\x\0")) && r[0],
13 "Section 1"
14 );
16 reportCompare(
17 "xy",
18 (r = /[\xy]+/.exec("\\xy\0")) && r[0],
19 "Section 2"
20 );
22 reportCompare(
23 "x0",
24 (r = /[\x0]+/.exec("\\x0\0")) && r[0],
25 "Section 3"
26 );
28 reportCompare(
29 "x0y",
30 (r = /[\x0y]+/.exec("\\x0y\0")) && r[0],
31 "Section 4"
32 );
34 reportCompare(
35 "\0",
36 (r = /[\x00]+/.exec("\\x\0")) && r[0],
37 "Section 5"
38 );
40 reportCompare(
41 "0\0",
42 (r = /[\x000]+/.exec("0\0")) && r[0],
43 "Section 6"
44 );
46 reportCompare(
47 "x",
48 (r = /^\x$/.exec("x")) && r[0],
49 "Section 7"
50 );
52 reportCompare(
53 "xy",
54 (r = /^\xy$/.exec("xy")) && r[0],
55 "Section 8"
56 );
58 reportCompare(
59 "x0",
60 (r = /^\x0$/.exec("x0")) && r[0],
61 "Section 9"
62 );
64 reportCompare(
65 "x0y",
66 (r = /^\x0y$/.exec("x0y")) && r[0],
67 "Section 10"
68 );
70 reportCompare(
71 null,
72 /^\x00$/.exec("\0" + "0"),
73 "Section 11"
74 );
76 reportCompare(
77 "\0" + "0",
78 (r = /^\x000$/.exec("\0" + "0")) && r[0],
79 "Section 12"
80 );
82 reportCompare(
83 "u",
84 (r = /[\u]+/.exec("\\u\0")) && r[0],
85 "Section 13"
86 );
88 reportCompare(
89 "uy",
90 (r = /[\uy]+/.exec("\\uy\0")) && r[0],
91 "Section 14"
92 );
94 reportCompare(
95 "u0",
96 (r = /[\u0]+/.exec("\\u0\0")) && r[0],
97 "Section 15"
98 );
100 reportCompare(
101 "u0",
102 (r = /[\u00]+/.exec("\\u0\0")) && r[0],
103 "Section 16"
104 );
106 reportCompare(
107 "u0",
108 (r = /[\u000]+/.exec("\\u0\0")) && r[0],
109 "Section 17"
110 );
112 reportCompare(
113 "u0y",
114 (r = /[\u0y]+/.exec("\\u0y\0")) && r[0],
115 "Section 18"
116 );
118 reportCompare(
119 "u0y",
120 (r = /[\u00y]+/.exec("\\u0y\0")) && r[0],
121 "Section 19"
122 );
124 reportCompare(
125 "u0y",
126 (r = /[\u000y]+/.exec("\\u0y\0")) && r[0],
127 "Section 20"
128 );
130 reportCompare(
131 "\0",
132 (r = /[\u0000]+/.exec("\\u\0")) && r[0],
133 "Section 21"
134 );
136 reportCompare(
137 "0\0",
138 (r = /[\u00000]+/.exec("0\0")) && r[0],
139 "Section 22"
140 );
142 reportCompare(
143 "u",
144 (r = /^\u$/.exec("u")) && r[0],
145 "Section 23"
146 );
148 reportCompare(
149 "uy",
150 (r = /^\uy$/.exec("uy")) && r[0],
151 "Section 24"
152 );
154 reportCompare(
155 "u0",
156 (r = /^\u0$/.exec("u0")) && r[0],
157 "Section 25"
158 );
160 reportCompare(
161 "u00",
162 (r = /^\u00$/.exec("u00")) && r[0],
163 "Section 26"
164 );
166 reportCompare(
167 "u000",
168 (r = /^\u000$/.exec("u000")) && r[0],
169 "Section 27"
170 );
172 reportCompare(
173 "u0y",
174 (r = /^\u0y$/.exec("u0y")) && r[0],
175 "Section 28"
176 );
178 reportCompare(
179 "u00y",
180 (r = /^\u00y$/.exec("u00y")) && r[0],
181 "Section 29"
182 );
184 reportCompare(
185 "u000y",
186 (r = /^\u000y$/.exec("u000y")) && r[0],
187 "Section 30"
188 );
190 reportCompare(
191 null,
192 /^\u0000$/.exec("\0" + "0"),
193 "Section 31"
194 );
196 reportCompare(
197 "\0" + "0",
198 (r = /^\u00000$/.exec("\0" + "0")) && r[0],
199 "Section 32"
200 );