@@ -24,9 +24,9 @@ var callback = function(stackframes) {
2424
2525var errback = function (err ) { console .log (err .message ); };
2626
27- StackTrace .get ().then (callback).catch (errback)
28- => Promise (Array [StackFrame], Error )
29- => callback ([StackFrame (' func1' , [], ' file.js' , 203 , 9 ), StackFrame (' func2' , [], ' http://localhost:3000/file.min.js' , 1 , 3284 )])
27+ StackTrace .get ().then (callback).catch (errback);
28+ // == => Promise(Array[StackFrame], Error)
29+ // == => callback([StackFrame('func1', [], 'file.js', 203, 9), StackFrame('func2', [], 'http://localhost:3000/file.min.js', 1, 3284)])
3030```
3131
3232#### window.onerror integration
@@ -42,29 +42,29 @@ window.onerror = function(msg, file, line, col, error) {
4242``` js
4343var error = new Error (' BOOM!' );
4444
45- StackTrace .fromError (error).then (callback).catch (errback)
46- => Promise (Array [StackFrame], Error )
45+ StackTrace .fromError (error).then (callback).catch (errback);
46+ // == => Promise(Array[StackFrame], Error)
4747```
4848
4949#### Generate a stacktrace from walking arguments.callee
5050This might capture arguments information, but isn't supported in ES5 strict-mode
5151``` js
52- StackTrace .generateArtificially ().then (callback).catch (errback)
53- => Promise (Array [StackFrame], Error )
52+ StackTrace .generateArtificially ().then (callback).catch (errback);
53+ // == => Promise(Array[StackFrame], Error)
5454```
5555
5656#### Trace every time a given function is invoked
5757``` js
5858// callback is called with an Array[StackFrame] every time wrapped function is called
59- var myFunc = function (arg ) { return ' Hello ' + arg; }
60- var myWrappedFunc = StackTrace .instrument (myFunc, callback, errback)
61- => Instrumented Function
59+ var myFunc = function (arg ) { return ' Hello ' + arg; };
60+ var myWrappedFunc = StackTrace .instrument (myFunc, callback, errback);
61+ // == => Instrumented Function
6262myWrappedFunc (' world' );
63- => ' Hello world'
63+ // == => 'Hello world'
6464
6565// Use this if you overwrote you original function
66- myFunc = StackTrace .deinstrument (myFunc)
67- => De- instrumented Function
66+ myFunc = StackTrace .deinstrument (myFunc);
67+ // == => De-instrumented Function
6868```
6969
7070## Get stacktrace.js
0 commit comments