1
- /*! Raven.js 3.6.1 (8c680b0 ) | github.com/getsentry/raven-js */
1
+ /*! Raven.js 3.7.0 (cf2ddee ) | github.com/getsentry/raven-js */
2
2
3
3
/*
4
4
* Includes TraceKit
@@ -182,7 +182,7 @@ Raven.prototype = {
182
182
// webpack (using a build step causes webpack #1617). Grunt verifies that
183
183
// this value matches package.json during build.
184
184
// See: https://github.com/getsentry/raven-js/issues/465
185
- VERSION : '3.6.1 ' ,
185
+ VERSION : '3.7.0 ' ,
186
186
187
187
debug : false ,
188
188
@@ -351,18 +351,18 @@ Raven.prototype = {
351
351
if ( func . __raven__ ) {
352
352
return func ;
353
353
}
354
+
355
+ // If this has already been wrapped in the past, return that
356
+ if ( func . __raven_wrapper__ ) {
357
+ return func . __raven_wrapper__ ;
358
+ }
354
359
} catch ( e ) {
355
- // Just accessing the __raven__ prop in some Selenium environments
360
+ // Just accessing custom props in some Selenium environments
356
361
// can cause a "Permission denied" exception (see raven-js#495).
357
362
// Bail on wrapping and return the function as-is (defers to window.onerror).
358
363
return func ;
359
364
}
360
365
361
- // If this has already been wrapped in the past, return that
362
- if ( func . __raven_wrapper__ ) {
363
- return func . __raven_wrapper__ ;
364
- }
365
-
366
366
function wrapped ( ) {
367
367
var args = [ ] , i = arguments . length ,
368
368
deep = ! options || options && options . deep !== false ;
@@ -957,7 +957,11 @@ Raven.prototype = {
957
957
} , wrappedBuiltIns ) ;
958
958
fill ( proto , 'removeEventListener' , function ( orig ) {
959
959
return function ( evt , fn , capture , secure ) {
960
- fn = fn && ( fn . __raven_wrapper__ ? fn . __raven_wrapper__ : fn ) ;
960
+ try {
961
+ fn = fn && ( fn . __raven_wrapper__ ? fn . __raven_wrapper__ : fn ) ;
962
+ } catch ( e ) {
963
+ // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
964
+ }
961
965
return orig . call ( this , evt , fn , capture , secure ) ;
962
966
} ;
963
967
} , wrappedBuiltIns ) ;
@@ -2289,153 +2293,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2289
2293
} ;
2290
2294
}
2291
2295
2292
- /**
2293
- * Computes stack trace information from the stacktrace property.
2294
- * Opera 10 uses this property.
2295
- * @param {Error } ex
2296
- * @return {?Object.<string, *> } Stack trace information.
2297
- */
2298
- function computeStackTraceFromStacktraceProp ( ex ) {
2299
- // Access and store the stacktrace property before doing ANYTHING
2300
- // else to it because Opera is not very good at providing it
2301
- // reliably in other circumstances.
2302
- var stacktrace = ex . stacktrace ;
2303
- if ( isUndefined ( ex . stacktrace ) || ! ex . stacktrace ) return ;
2304
-
2305
- var opera10Regex = / l i n e ( \d + ) .* s c r i p t (?: i n ) ? ( \S + ) (?: : i n f u n c t i o n ( \S + ) ) ? $ / i,
2306
- opera11Regex = / l i n e ( \d + ) , c o l u m n ( \d + ) \s * (?: i n (?: < a n o n y m o u s f u n c t i o n : ( [ ^ > ] + ) > | ( [ ^ \) ] + ) ) \( ( .* ) \) ) ? i n ( .* ) : \s * $ / i,
2307
- lines = stacktrace . split ( '\n' ) ,
2308
- stack = [ ] ,
2309
- parts ;
2310
-
2311
- for ( var line = 0 ; line < lines . length ; line += 2 ) {
2312
- var element = null ;
2313
- if ( ( parts = opera10Regex . exec ( lines [ line ] ) ) ) {
2314
- element = {
2315
- 'url' : parts [ 2 ] ,
2316
- 'line' : + parts [ 1 ] ,
2317
- 'column' : null ,
2318
- 'func' : parts [ 3 ] ,
2319
- 'args' :[ ]
2320
- } ;
2321
- } else if ( ( parts = opera11Regex . exec ( lines [ line ] ) ) ) {
2322
- element = {
2323
- 'url' : parts [ 6 ] ,
2324
- 'line' : + parts [ 1 ] ,
2325
- 'column' : + parts [ 2 ] ,
2326
- 'func' : parts [ 3 ] || parts [ 4 ] ,
2327
- 'args' : parts [ 5 ] ? parts [ 5 ] . split ( ',' ) : [ ]
2328
- } ;
2329
- }
2330
-
2331
- if ( element ) {
2332
- if ( ! element . func && element . line ) {
2333
- element . func = UNKNOWN_FUNCTION ;
2334
- }
2335
-
2336
- stack . push ( element ) ;
2337
- }
2338
- }
2339
-
2340
- if ( ! stack . length ) {
2341
- return null ;
2342
- }
2343
-
2344
- return {
2345
- 'name' : ex . name ,
2346
- 'message' : ex . message ,
2347
- 'url' : getLocationHref ( ) ,
2348
- 'stack' : stack
2349
- } ;
2350
- }
2351
-
2352
- /**
2353
- * NOT TESTED.
2354
- * Computes stack trace information from an error message that includes
2355
- * the stack trace.
2356
- * Opera 9 and earlier use this method if the option to show stack
2357
- * traces is turned on in opera:config.
2358
- * @param {Error } ex
2359
- * @return {?Object.<string, *> } Stack information.
2360
- */
2361
- function computeStackTraceFromOperaMultiLineMessage ( ex ) {
2362
- // Opera includes a stack trace into the exception message. An example is:
2363
- //
2364
- // Statement on line 3: Undefined variable: undefinedFunc
2365
- // Backtrace:
2366
- // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz
2367
- // undefinedFunc(a);
2368
- // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy
2369
- // zzz(x, y, z);
2370
- // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx
2371
- // yyy(a, a, a);
2372
- // Line 1 of function script
2373
- // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); }
2374
- // ...
2375
-
2376
- var lines = ex . message . split ( '\n' ) ;
2377
- if ( lines . length < 4 ) {
2378
- return null ;
2379
- }
2380
-
2381
- var lineRE1 = / ^ \s * L i n e ( \d + ) o f l i n k e d s c r i p t ( (?: f i l e | h t t p s ? | b l o b ) \S + ) (?: : i n f u n c t i o n ( \S + ) ) ? \s * $ / i,
2382
- lineRE2 = / ^ \s * L i n e ( \d + ) o f i n l i n e # ( \d + ) s c r i p t i n ( (?: f i l e | h t t p s ? | b l o b ) \S + ) (?: : i n f u n c t i o n ( \S + ) ) ? \s * $ / i,
2383
- lineRE3 = / ^ \s * L i n e ( \d + ) o f f u n c t i o n s c r i p t \s * $ / i,
2384
- stack = [ ] ,
2385
- scripts = document . getElementsByTagName ( 'script' ) ,
2386
- parts ;
2387
-
2388
- for ( var line = 2 ; line < lines . length ; line += 2 ) {
2389
- var item = null ;
2390
- if ( ( parts = lineRE1 . exec ( lines [ line ] ) ) ) {
2391
- item = {
2392
- 'url' : parts [ 2 ] ,
2393
- 'func' : parts [ 3 ] ,
2394
- 'args' : [ ] ,
2395
- 'line' : + parts [ 1 ] ,
2396
- 'column' : null
2397
- } ;
2398
- } else if ( ( parts = lineRE2 . exec ( lines [ line ] ) ) ) {
2399
- item = {
2400
- 'url' : parts [ 3 ] ,
2401
- 'func' : parts [ 4 ] ,
2402
- 'args' : [ ] ,
2403
- 'line' : + parts [ 1 ] ,
2404
- 'column' : null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number.
2405
- } ;
2406
- var relativeLine = ( + parts [ 1 ] ) ; // relative to the start of the <SCRIPT> block
2407
- } else if ( ( parts = lineRE3 . exec ( lines [ line ] ) ) ) {
2408
- var url = window . location . href . replace ( / # .* $ / , '' ) ;
2409
- item = {
2410
- 'url' : url ,
2411
- 'func' : '' ,
2412
- 'args' : [ ] ,
2413
- 'line' : parts [ 1 ] ,
2414
- 'column' : null
2415
- } ;
2416
- }
2417
-
2418
- if ( item ) {
2419
- if ( ! item . func ) {
2420
- item . func = UNKNOWN_FUNCTION ;
2421
- }
2422
-
2423
- stack . push ( item ) ;
2424
- }
2425
- }
2426
-
2427
- if ( ! stack . length ) {
2428
- return null ; // could not parse multiline exception message as Opera stack trace
2429
- }
2430
-
2431
- return {
2432
- 'name' : ex . name ,
2433
- 'message' : lines [ 0 ] ,
2434
- 'url' : getLocationHref ( ) ,
2435
- 'stack' : stack
2436
- } ;
2437
- }
2438
-
2439
2296
/**
2440
2297
* Adds information about the first frame to incomplete stack traces.
2441
2298
* Safari and IE require this to get complete data on the first frame.
@@ -2560,20 +2417,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2560
2417
var stack = null ;
2561
2418
depth = ( depth == null ? 0 : + depth ) ;
2562
2419
2563
- try {
2564
- // This must be tried first because Opera 10 *destroys*
2565
- // its stacktrace property if you try to access the stack
2566
- // property first!!
2567
- stack = computeStackTraceFromStacktraceProp ( ex ) ;
2568
- if ( stack ) {
2569
- return stack ;
2570
- }
2571
- } catch ( e ) {
2572
- if ( TraceKit . debug ) {
2573
- throw e ;
2574
- }
2575
- }
2576
-
2577
2420
try {
2578
2421
stack = computeStackTraceFromStackProp ( ex ) ;
2579
2422
if ( stack ) {
@@ -2585,17 +2428,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2585
2428
}
2586
2429
}
2587
2430
2588
- try {
2589
- stack = computeStackTraceFromOperaMultiLineMessage ( ex ) ;
2590
- if ( stack ) {
2591
- return stack ;
2592
- }
2593
- } catch ( e ) {
2594
- if ( TraceKit . debug ) {
2595
- throw e ;
2596
- }
2597
- }
2598
-
2599
2431
try {
2600
2432
stack = computeStackTraceByWalkingCallerChain ( ex , depth + 1 ) ;
2601
2433
if ( stack ) {
0 commit comments