Debian Codegraph @

js/src/jit-test/tests/auto-regress/bug730806.js

raw
1 // Binary: cache/js-opt-32-2dc40eb83023-linux
2 // Flags: -m -n -a
3 //
4 function toPrinted(value) {
5 return value = value.replace(/\\n/g, 'NL')
6 .replace(/\\r/g, 'CR')
7 .replace(/[^\x20-\x7E]+/g, escapeString);
8 }
9 function escapeString (str)
10 {
11 var a, b, c, d;
12 var len = str.length;
13 var result = "";
14 var digits = ["0", "1", "2", "3", "4", "5", "6", "7",
15 "8", "9", "A", "B", "C", "D", "E", "F"];
16 for (var i=0; i<len; i++)
17 {
18 var ch = str.charCodeAt(i);
19 a = digits[ch & 0xf];
20 if (ch)
21 {
22 c = digits[ch & 0xf];
23 ch >>= 4;
24 d = digits[ch & 0xf];
25 result += "\\u" + d + c + b + a;
26 }
27 }
28 }
29 function reportCompare (expected, actual, description) {
30 function test() {
31 try
32 {
33 }
34 catch(e)
35 {
36 }
37 }
38 }
39 try {
40 gczeal(2,4);
41 function setprop() {
42 }
43 } catch(exc1) {}
44 var trimMethods = ['trim', 'trimLeft', 'trimRight'];
45 var whitespace = [
46 {s : '\u2028', t : 'LINE SEPARATOR'},
47 ];
48 for (var j = 0; j < trimMethods.length; ++j)
49 {
50 var method = trimMethods[j];
51 for (var i = 0; i < whitespace.length; ++i)
52 {
53 var v = whitespace[i].s;
54 var t = whitespace[i].t;
55 v = v + v + v;
56 str = v;
57 expected = '';
58 actual = str[method]();
59 reportCompare(expected, actual, t + ':' + '"' + toPrinted(str) + '".' + method + '()');
60 }
61 }