File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1818 document . getElementById ( "info" ) . innerHTML = text ;
1919 }
2020
21+ function detectMode ( ) {
22+ var p = new printStackTrace . implementation ( ) , mode = p . mode ( lastException ) ;
23+ info ( 'Stack tracing mode: ' + mode ) ;
24+ }
25+
2126 function dumpStacktrace ( guess ) {
2227 var trace = printStackTrace ( {
2328 e : lastException ,
6873 dumpException ( ex ) ;
6974 }
7075 }
76+
77+ function dumpDOMException ( ) {
78+ try {
79+ document . body . removeChild ( document . createElement ( 'div' ) ) ;
80+ } catch ( ex ) {
81+ dumpException ( ex ) ;
82+ }
83+ }
84+
85+ function dumpCallChain ( ) {
86+ dumpException ( { message : 'Error' } ) ;
87+ try {
88+ dumpStacktrace ( ) ;
89+ } catch ( ex ) {
90+ info ( 'Exception while processing stack trace:\n' + ex ) ;
91+ }
92+ }
93+
94+ function dumpCallChainInStrictMode ( ) {
95+ "use strict" ;
96+ dumpCallChain ( ) ;
97+ }
7198 </ script >
7299</ head >
73100< body >
81108< button onclick ="dumpExceptionAnonymous(); " title ="Stack with anonymous function "> Exception 2</ button >
82109< button onclick ="dumpExceptionInEval(); " title ="Exception in eval() "> Exception 3</ button >
83110< button onclick ="dumpExceptionMultiLine(); " title ="Multi-line message in exception "> Exception 4</ button >
111+ < button onclick ="dumpDOMException(); " title ="DOM exception (without stack in Firefox) "> Exception 5</ button >
112+ < br />
113+ < button onclick ="dumpCallChain(); " title ="Process call chain "> Call chain</ button >
114+ < button onclick ="dumpCallChainInStrictMode(); " title ="Process call chain in strict mode "> Call chain in strict mode
115+ </ button >
84116< br />
117+ < button onclick ="detectMode(); "> Detect mode</ button >
85118< button onclick ="dumpStacktrace(); "> Process stack trace</ button >
86119< button onclick ="dumpStacktrace(true); "> Guess anonymous functions</ button >
87120</ body >
You can’t perform that action at this time.
0 commit comments