OLD | NEW |
1 <script> | 1 <script> |
2 if (window.testRunner) | 2 if (window.testRunner) |
3 testRunner.dumpAsText(); | 3 testRunner.dumpAsText(); |
4 | 4 |
5 function log(msg) { | 5 function log(msg) { |
6 document.getElementById("console").innerHTML += msg + "<br>"; | 6 document.getElementById("console").innerHTML += msg + "<br>"; |
7 } | 7 } |
8 | 8 |
9 function test1() | 9 function test1() |
10 { | 10 { |
11 window.onerror = function (error, url, line) { | 11 window.onerror = function (error, url, line, column) { |
12 url = url ? url.match( /[^\/]+\/?$/ )[0] : url; | 12 url = url ? url.match( /[^\/]+\/?$/ )[0] : url; |
13 log("Error caught successfully: " + error + "\nFile: " + url + "\nLine:
" + line) | 13 log("Error caught successfully: " + error + "\nFile: " + url + "\nLine:
" + line + "\nColumn: " + column) |
14 return true; | 14 return true; |
15 }; | 15 }; |
16 eval("a("); | 16 eval("a("); |
17 } | 17 } |
18 </script> | 18 </script> |
19 <body onload="test1();"> | 19 <body onload="test1();"> |
20 <p>Test that window.onerror is invoked for syntax error in eval. You should see
a log record if window.onerror is working properly for this test.<a href="https:
//bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p> | 20 <p>Test that window.onerror is invoked for syntax error in eval. You should see
a log record if window.onerror is working properly for this test.<a href="https:
//bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p> |
21 <hr> | 21 <hr> |
22 <div id='console'></div> | 22 <div id='console'></div> |
23 </body> | 23 </body> |
OLD | NEW |