OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../fast/js/resources/js-test-pre.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <script src="resources/shared.js"></script> | 4 <script src="resources/shared.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 | 8 |
9 var worker = startWorker('resources/transaction-complete-workers.js'); | 9 var worker = startWorker('resources/transaction-complete-workers.js'); |
10 | 10 |
11 // FIXME: It should be possible for the worker to set self.onerror to catch the
event | 11 // FIXME: It should be possible for the worker to set self.onerror to catch the
event |
12 // and call event.preventDefault(), but in the current Worker implementation the
raw | 12 // and call event.preventDefault(), but in the current Worker implementation the
raw |
13 // exception is seen by the event handler in the worker, not an ErrorEvent objec
t. | 13 // exception is seen by the event handler in the worker, not an ErrorEvent objec
t. |
14 | 14 |
15 var orig_onerror = worker.onerror; | 15 var orig_onerror = worker.onerror; |
16 worker.onerror = function (event) { | 16 worker.onerror = function (event) { |
17 if (event.message === "Uncaught Error: ignore this" || event.message === "Er
ror: ignore this") { | 17 if (event.message === "Uncaught Error: ignore this" || event.message === "Er
ror: ignore this") { |
18 debug("Got expected error from worker, ignoring"); | 18 debug("Got expected error from worker, ignoring"); |
19 evalAndLog("event.preventDefault()"); | 19 evalAndLog("event.preventDefault()"); |
20 } else if (orig_onerror) { | 20 } else if (orig_onerror) { |
21 orig_onerror(event); | 21 orig_onerror(event); |
22 } | 22 } |
23 }; | 23 }; |
24 | 24 |
25 | 25 |
26 </script> | 26 </script> |
27 </body> | 27 </body> |
28 </html> | 28 </html> |
OLD | NEW |