forked from stacktracejs/stacktrace.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path27-1.html
More file actions
29 lines (28 loc) · 915 Bytes
/
Copy path27-1.html
File metadata and controls
29 lines (28 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<title>Issue #27</title>
<script src="../../stacktrace.js"></script>
<script>
window.onerror = function(errorMsg, url, lineNumber) {
alert(errorMsg + "\nURL: " + url + "\nLine number: " + lineNumber);
// Previous line gets executed
var trace;
try {
// Firefox enters printStackTrace. Leaves silently somewhere in there
trace = printStackTrace().join('\n\n');
// Execution does not arrive here (as evidenced in debugger)
} catch (e) {
// nothing gets thrown/caught in Firefox
// error console empty (the original uncaught exception is logged)
}
// Execution does not arrive here
// (as evidenced in debugger and actual browser window)
alert(trace);
return true;
};
// Somewhere error gets thrown
throw 'An error occurred';
</script>
</head>
<body></body>
</html>