@@ -80,18 +80,18 @@ TraceKit.report = (function reportModuleWrapper() {
80
80
lastExceptionStack = null ;
81
81
82
82
/**
83
- * Add a crash handler.
84
- * @param {Function } handler
85
- */
83
+ * Add a crash handler.
84
+ * @param {Function } handler
85
+ */
86
86
function subscribe ( handler ) {
87
87
installGlobalHandler ( ) ;
88
88
handlers . push ( handler ) ;
89
89
}
90
90
91
91
/**
92
- * Remove a crash handler.
93
- * @param {Function } handler
94
- */
92
+ * Remove a crash handler.
93
+ * @param {Function } handler
94
+ */
95
95
function unsubscribe ( handler ) {
96
96
for ( var i = handlers . length - 1 ; i >= 0 ; -- i ) {
97
97
if ( handlers [ i ] === handler ) {
@@ -101,17 +101,17 @@ TraceKit.report = (function reportModuleWrapper() {
101
101
}
102
102
103
103
/**
104
- * Remove all crash handlers.
105
- */
104
+ * Remove all crash handlers.
105
+ */
106
106
function unsubscribeAll ( ) {
107
107
uninstallGlobalHandler ( ) ;
108
108
handlers = [ ] ;
109
109
}
110
110
111
111
/**
112
- * Dispatch stack information to all handlers.
113
- * @param {Object.<string, *> } stack
114
- */
112
+ * Dispatch stack information to all handlers.
113
+ * @param {Object.<string, *> } stack
114
+ */
115
115
function notifyHandlers ( stack , isWindowError ) {
116
116
var exception = null ;
117
117
if ( isWindowError && ! TraceKit . collectWindowErrors ) {
@@ -135,16 +135,16 @@ TraceKit.report = (function reportModuleWrapper() {
135
135
var _oldOnerrorHandler , _onErrorHandlerInstalled ;
136
136
137
137
/**
138
- * Ensures all global unhandled exceptions are recorded.
139
- * Supported by Gecko and IE.
140
- * @param {string } msg Error message.
141
- * @param {string } url URL of script that generated the exception.
142
- * @param {(number|string) } lineNo The line number at which the error
143
- * occurred.
144
- * @param {?(number|string) } colNo The column number at which the error
145
- * occurred.
146
- * @param {?Error } ex The actual Error object.
147
- */
138
+ * Ensures all global unhandled exceptions are recorded.
139
+ * Supported by Gecko and IE.
140
+ * @param {string } msg Error message.
141
+ * @param {string } url URL of script that generated the exception.
142
+ * @param {(number|string) } lineNo The line number at which the error
143
+ * occurred.
144
+ * @param {?(number|string) } colNo The column number at which the error
145
+ * occurred.
146
+ * @param {?Error } ex The actual Error object.
147
+ */
148
148
function traceKitWindowOnError ( msg , url , lineNo , colNo , ex ) {
149
149
var stack = null ;
150
150
// If 'ex' is ErrorEvent, get real Error from inside
@@ -232,12 +232,12 @@ TraceKit.report = (function reportModuleWrapper() {
232
232
}
233
233
234
234
/**
235
- * Reports an unhandled Error to TraceKit.
236
- * @param {Error } ex
237
- * @param {?boolean } rethrow If false, do not re-throw the exception.
238
- * Only used for window.onerror to not cause an infinite loop of
239
- * rethrowing.
240
- */
235
+ * Reports an unhandled Error to TraceKit.
236
+ * @param {Error } ex
237
+ * @param {?boolean } rethrow If false, do not re-throw the exception.
238
+ * Only used for window.onerror to not cause an infinite loop of
239
+ * rethrowing.
240
+ */
241
241
function report ( ex , rethrow ) {
242
242
var args = _slice . call ( arguments , 1 ) ;
243
243
if ( lastExceptionStack ) {
@@ -364,16 +364,16 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
364
364
// ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
365
365
366
366
/**
367
- * Computes stack trace information from the stack property.
368
- * Chrome and Gecko use this property.
369
- * @param {Error } ex
370
- * @return {?Object.<string, *> } Stack trace information.
371
- */
367
+ * Computes stack trace information from the stack property.
368
+ * Chrome and Gecko use this property.
369
+ * @param {Error } ex
370
+ * @return {?Object.<string, *> } Stack trace information.
371
+ */
372
372
function computeStackTraceFromStackProp ( ex ) {
373
373
if ( typeof ex . stack === 'undefined' || ! ex . stack ) return ;
374
374
375
- var chrome = / ^ \s * a t ( .* ?) ? \( ( (?: f i l e | h t t p s ? | b l o b | c h r o m e - e x t e n s i o n | n a t i v e | e v a l | w e b p a c k | < a n o n y m o u s > | [ a - z ] : | \/ ) .* ?) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \) ? \s * $ / i,
376
- gecko = / ^ \s * ( .* ?) (?: \( ( .* ?) \) ) ? (?: ^ | @ ) ( (?: f i l e | h t t p s ? | b l o b | c h r o m e | w e b p a c k | r e s o u r c e | \[ n a t i v e ) .* ?| [ ^ @ ] * b u n d l e ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i,
375
+ var chrome = / ^ \s * a t (?: ( .* ?) ? \( ) ? ( (?: f i l e | h t t p s ? | b l o b | c h r o m e - e x t e n s i o n | n a t i v e | e v a l | w e b p a c k | < a n o n y m o u s > | [ a - z ] : | \/ ) .* ?) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \) ? \s * $ / i,
376
+ gecko = / ^ \s * ( .* ?) (?: \( ( .* ?) \) ) ? (?: ^ | @ ) ( (?: f i l e | h t t p s ? | b l o b | c h r o m e | w e b p a c k | r e s o u r c e | m o z - e x t e n s i o n | \[ n a t i v e ) .* ?| [ ^ @ ] * b u n d l e ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i,
377
377
winjs = / ^ \s * a t (?: ( (?: \[ o b j e c t o b j e c t \] ) ? .+ ) ) ? \( ? ( (?: f i l e | m s - a p p x (?: - w e b ) | h t t p s ? | w e b p a c k | b l o b ) : .* ?) : ( \d + ) (?: : ( \d + ) ) ? \) ? \s * $ / i,
378
378
// Used to additionally parse URL/line/column from eval frames
379
379
geckoEval = / ( \S + ) l i n e ( \d + ) (?: > e v a l l i n e \d + ) * > e v a l / i,
@@ -455,18 +455,18 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
455
455
}
456
456
457
457
/**
458
- * Adds information about the first frame to incomplete stack traces.
459
- * Safari and IE require this to get complete data on the first frame.
460
- * @param {Object.<string, *> } stackInfo Stack trace information from
461
- * one of the compute* methods.
462
- * @param {string } url The URL of the script that caused an error.
463
- * @param {(number|string) } lineNo The line number of the script that
464
- * caused an error.
465
- * @param {string= } message The error generated by the browser, which
466
- * hopefully contains the name of the object that caused the error.
467
- * @return {boolean } Whether or not the stack information was
468
- * augmented.
469
- */
458
+ * Adds information about the first frame to incomplete stack traces.
459
+ * Safari and IE require this to get complete data on the first frame.
460
+ * @param {Object.<string, *> } stackInfo Stack trace information from
461
+ * one of the compute* methods.
462
+ * @param {string } url The URL of the script that caused an error.
463
+ * @param {(number|string) } lineNo The line number of the script that
464
+ * caused an error.
465
+ * @param {string= } message The error generated by the browser, which
466
+ * hopefully contains the name of the object that caused the error.
467
+ * @return {boolean } Whether or not the stack information was
468
+ * augmented.
469
+ */
470
470
function augmentStackTraceWithInitialElement ( stackInfo , url , lineNo , message ) {
471
471
var initial = {
472
472
url : url ,
@@ -505,14 +505,14 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
505
505
}
506
506
507
507
/**
508
- * Computes stack trace information by walking the arguments.caller
509
- * chain at the time the exception occurred. This will cause earlier
510
- * frames to be missed but is the only way to get any stack trace in
511
- * Safari and IE. The top frame is restored by
512
- * {@link augmentStackTraceWithInitialElement}.
513
- * @param {Error } ex
514
- * @return {?Object.<string, *> } Stack trace information.
515
- */
508
+ * Computes stack trace information by walking the arguments.caller
509
+ * chain at the time the exception occurred. This will cause earlier
510
+ * frames to be missed but is the only way to get any stack trace in
511
+ * Safari and IE. The top frame is restored by
512
+ * {@link augmentStackTraceWithInitialElement}.
513
+ * @param {Error } ex
514
+ * @return {?Object.<string, *> } Stack trace information.
515
+ */
516
516
function computeStackTraceByWalkingCallerChain ( ex , depth ) {
517
517
var functionName = / f u n c t i o n \s + ( [ _ $ a - z A - Z \xA0 - \uFFFF ] [ _ $ a - z A - Z 0 - 9 \xA0 - \uFFFF ] * ) ? \s * \( / i,
518
518
stack = [ ] ,
@@ -582,10 +582,10 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
582
582
}
583
583
584
584
/**
585
- * Computes a stack trace for an exception.
586
- * @param {Error } ex
587
- * @param {(string|number)= } depth
588
- */
585
+ * Computes a stack trace for an exception.
586
+ * @param {Error } ex
587
+ * @param {(string|number)= } depth
588
+ */
589
589
function computeStackTrace ( ex , depth ) {
590
590
var stack = null ;
591
591
depth = depth == null ? 0 : + depth ;
0 commit comments