5 testRunner.dumpAsText();
7 function print(message, color)
9 var paragraph = document.createElement("div");
10 paragraph.appendChild(document.createTextNode(message));
11 paragraph.style.fontFamily = "monospace";
13 paragraph.style.color = color;
14 document.getElementById("console").appendChild(paragraph);
19 // must be last because the exception ends JavaScript execution
20 window.onerror = function (error, url, line) {
21 url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
22 print("PASS: caught global error: " + error + " at " + url + ":" + line, "green");
25 hahaha_good_luck_finding_me(); // caught by window.onerror
29 <body onload="test();">
30 <p>This page tests setting onerror handlers through the DOM. If it passes, you will
31 see "PASS" messages below.<a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
33 <div id='console'></div>