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