@@ -158,28 +158,35 @@ TraceKit.report = (function reportModuleWrapper() {
158
158
* @param {(number|string) } lineNo The line number at which the error
159
159
* occurred.
160
160
*/
161
- function traceKitWindowOnError ( message , url , lineNo ) {
161
+ function traceKitWindowOnError ( message , url , lineNo , columnNo , errorObj ) {
162
162
var stack = null ;
163
163
164
- if ( lastExceptionStack ) {
165
- TraceKit . computeStackTrace . augmentStackTraceWithInitialElement ( lastExceptionStack , url , lineNo , message ) ;
166
- stack = lastExceptionStack ;
167
- lastExceptionStack = null ;
168
- lastException = null ;
169
- } else {
170
- var location = {
171
- 'url' : url ,
172
- 'line' : lineNo
173
- } ;
174
- location . func = TraceKit . computeStackTrace . guessFunctionName ( location . url , location . line ) ;
175
- location . context = TraceKit . computeStackTrace . gatherContext ( location . url , location . line ) ;
176
- stack = {
177
- 'mode' : 'onerror' ,
178
- 'message' : message ,
179
- 'url' : document . location . href ,
180
- 'stack' : [ location ] ,
181
- 'useragent' : navigator . userAgent
182
- } ;
164
+ if ( errorObj ) {
165
+ stack = TraceKit . computeStackTrace ( errorObj ) ;
166
+ }
167
+ else
168
+ {
169
+ if ( lastExceptionStack ) {
170
+ TraceKit . computeStackTrace . augmentStackTraceWithInitialElement ( lastExceptionStack , url , lineNo , message ) ;
171
+ stack = lastExceptionStack ;
172
+ lastExceptionStack = null ;
173
+ lastException = null ;
174
+ } else {
175
+ var location = {
176
+ 'url' : url ,
177
+ 'line' : lineNo ,
178
+ 'column' : columnNo
179
+ } ;
180
+ location . func = TraceKit . computeStackTrace . guessFunctionName ( location . url , location . line ) ;
181
+ location . context = TraceKit . computeStackTrace . gatherContext ( location . url , location . line ) ;
182
+ stack = {
183
+ 'mode' : 'onerror' ,
184
+ 'message' : message ,
185
+ 'url' : document . location . href ,
186
+ 'stack' : [ location ] ,
187
+ 'useragent' : navigator . userAgent
188
+ } ;
189
+ }
183
190
}
184
191
185
192
notifyHandlers ( stack , 'from window.onerror' ) ;
0 commit comments