3 <p>Test that "error" event listener added with window.addEventListener is invoked for uncaucht exceptions. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
4 <div id="console"></div>
6 if (window.layoutTestController)
7 layoutTestController.dumpAsText();
10 document.getElementById("console").innerHTML += msg + "<br>";
13 function lastPathComponent(url) {
14 return url ? url.match( /[^\/]+\/?$/ )[0] : url;
17 window.addEventListener("error", function(e) {
18 log("event passed to the listener is the same as window.event: " + (window.event === e));
19 log("Event details:");
20 log("type: " + e.type);
21 log("phase: " + e.eventPhase)
22 log("currentTarget is the global object: " + (e.currentTarget === window));
23 log("message: " + e.message);
24 log("filename: " + lastPathComponent(e.filename));
25 log("lineno: " + e.lineno);
29 throw new Error("My fault.");