OLD | NEW |
1 %PDF-1.7 | 1 %PDF-1.7 |
2 % ò¤ô | 2 % ò¤ô |
3 1 0 obj << | 3 1 0 obj << |
4 /Type /Catalog | 4 /Type /Catalog |
5 /Pages 2 0 R | 5 /Pages 2 0 R |
6 /AcroForm 6 0 R | 6 /AcroForm 6 0 R |
7 /Names <</JavaScript 13 0 R>> | 7 /Names <</JavaScript 13 0 R>> |
8 >> | 8 >> |
9 endobj | 9 endobj |
10 2 0 obj << | 10 2 0 obj << |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 /JS 50 0 R | 59 /JS 50 0 R |
60 >> | 60 >> |
61 endobj | 61 endobj |
62 13 0 obj << | 62 13 0 obj << |
63 /Names [(startDelay) 11 0 R] | 63 /Names [(startDelay) 11 0 R] |
64 >> | 64 >> |
65 endobj | 65 endobj |
66 50 0 obj << | 66 50 0 obj << |
67 >> | 67 >> |
68 stream | 68 stream |
69 function fireTimeOut() { | 69 var timeOut = 0; |
70 app.alert("hello world"); | 70 var array = new Array(1024*4); |
| 71 var doc = this; |
| 72 |
| 73 function myFunction() { |
| 74 try { |
| 75 // Free the Timer Objects |
| 76 app.clearTimeOut(timeOut); |
| 77 for (var i=0; i<array.length; i++) { |
| 78 for (var j=0; j<array[i].length; j++) { |
| 79 app.clearTimeOut(array[i][j]); |
| 80 } |
| 81 } |
| 82 |
| 83 // Trigger the Garbage Collection |
| 84 array.length = 0; |
| 85 array.push(new ArrayBuffer(1024*1024)); |
| 86 array.length=0; |
| 87 array.length=1024*4; |
| 88 var str = 'AA'; |
| 89 for (var i = 0; i < array.length ; i++) { |
| 90 for (var j = 0; j < 10; j++ ) { |
| 91 doc.addIcon(str + "-" + str + str + str + str + str, doc.icons); |
| 92 } |
| 93 } |
| 94 } catch(err) { |
| 95 app.alert(err); |
| 96 } |
71 } | 97 } |
72 function fireInterval() { | 98 |
73 app.alert("goodbye world"); | 99 function main() { |
| 100 try { |
| 101 for (var i = 0; i < array.length ; i++) { |
| 102 if (i == array.length / 2) { |
| 103 timeOut = app.setTimeOut("myFunction()", 1000); |
| 104 } |
| 105 array[i] = new Array(4); |
| 106 for (var j = 0; j < array[i].length ; j++ ) { |
| 107 array[i][j] = app.setTimeOut("aaaaaaaaaa()", 100000); |
| 108 } |
| 109 } |
| 110 } catch(err) { |
| 111 app.alert(err); |
| 112 } |
74 } | 113 } |
75 var timer = app.setTimeOut("fireTimeOut()", 3000); | 114 |
76 var interval = app.setInterval("fireInterval()", 1000); | 115 // Execute the JS. |
77 // Clear timers before they fire. | 116 app.setTimeOut("main()", 1000); |
78 app.clearTimeOut(timer); | 117 |
79 app.clearInterval(interval); | |
80 // Check that clearing a cleared timer is ok. | |
81 app.clearTimeOut(timer); | |
82 app.clearInterval(interval); | |
83 // Check that invoking the wrong clear method is ok | |
84 var timer = app.setTimeOut("fireTimeOut()", 3000); | |
85 var interval = app.setInterval("fireInterval()", 1000); | |
86 app.clearTimeOut(interval); | |
87 app.clearInterval(timer); | |
88 // Check that clearing a non-timer is ok. | |
89 app.clearTimeOut({"size": 42}); | |
90 app.clearInterval({"size": 42}); | |
91 // Be sure all of this code ran to completion. | 118 // Be sure all of this code ran to completion. |
92 app.alert("done"); | 119 app.alert("done"); |
93 endstream | 120 endstream |
94 endobj | 121 endobj |
95 xref | 122 xref |
96 0 51 | 123 0 51 |
97 0000000000 65535 f | 124 0000000000 65535 f |
98 0000000015 00000 n | 125 0000000015 00000 n |
99 0000000118 00000 n | 126 0000000118 00000 n |
100 0000000000 65535 f | 127 0000000000 65535 f |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 0000000000 65535 f | 169 0000000000 65535 f |
143 0000000000 65535 f | 170 0000000000 65535 f |
144 0000000000 65535 f | 171 0000000000 65535 f |
145 0000000000 65535 f | 172 0000000000 65535 f |
146 0000000000 65535 f | 173 0000000000 65535 f |
147 0000000822 00000 n | 174 0000000822 00000 n |
148 trailer << | 175 trailer << |
149 /Root 1 0 R | 176 /Root 1 0 R |
150 >> | 177 >> |
151 startxref | 178 startxref |
152 1655 | 179 2036 |
153 %%EOF | 180 %%EOF |
OLD | NEW |