1
- import { isUndefined , isError , isErrorEvent } from '@sentry/utils/is' ;
1
+ 'use strict' ;
2
+
3
+ Object . defineProperty ( exports , '__esModule' , {
4
+ value : true ,
5
+ } ) ;
6
+ exports . computeStackTrace = exports . installGlobalUnhandledRejectionHandler = exports . installGlobalHandler = exports . subscribe = undefined ;
7
+
8
+ var _extends =
9
+ Object . assign ||
10
+ function ( target ) {
11
+ for ( var i = 1 ; i < arguments . length ; i ++ ) {
12
+ var source = arguments [ i ] ;
13
+ for ( var key in source ) {
14
+ if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
15
+ target [ key ] = source [ key ] ;
16
+ }
17
+ }
18
+ }
19
+ return target ;
20
+ } ;
21
+
22
+ var _is = require ( '@sentry/utils/is' ) ;
2
23
3
24
/**
4
25
* TraceKit - Cross brower stack traces
@@ -232,14 +253,14 @@ TraceKit.report = (function reportModuleWrapper() {
232
253
function traceKitWindowOnError ( message , url , lineNo , columnNo , errorObj ) {
233
254
var stack = null ;
234
255
// If 'errorObj' is ErrorEvent, get real Error from inside
235
- errorObj = isErrorEvent ( errorObj ) ? errorObj . error : errorObj ;
256
+ errorObj = ( 0 , _is . isErrorEvent ) ( errorObj ) ? errorObj . error : errorObj ;
236
257
// If 'message' is ErrorEvent, get real message from inside
237
- message = isErrorEvent ( message ) ? message . message : message ;
258
+ message = ( 0 , _is . isErrorEvent ) ( message ) ? message . message : message ;
238
259
239
260
if ( lastExceptionStack ) {
240
261
TraceKit . computeStackTrace . augmentStackTraceWithInitialElement ( lastExceptionStack , url , lineNo , message ) ;
241
262
processLastException ( ) ;
242
- } else if ( errorObj && isError ( errorObj ) ) {
263
+ } else if ( errorObj && ( 0 , _is . isError ) ( errorObj ) ) {
243
264
stack = TraceKit . computeStackTrace ( errorObj ) ;
244
265
notifyHandlers ( stack , true , errorObj ) ;
245
266
} else {
@@ -266,13 +287,12 @@ TraceKit.report = (function reportModuleWrapper() {
266
287
message : msg ,
267
288
mode : 'onerror' ,
268
289
stack : [
269
- {
270
- ...location ,
290
+ _extends ( { } , location , {
271
291
// Firefox sometimes doesn't return url correctly and this is an old behavior
272
292
// that I prefer to port here as well.
273
293
// It can be altered only here, as previously it's using `location.url` for other things — Kamil
274
294
url : location . url || getLocationHref ( ) ,
275
- } ,
295
+ } ) ,
276
296
] ,
277
297
} ;
278
298
@@ -502,7 +522,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
502
522
return '' ;
503
523
}
504
524
try {
505
- var getXHR = function ( ) {
525
+ var getXHR = function getXHR ( ) {
506
526
try {
507
527
return new window . XMLHttpRequest ( ) ;
508
528
} catch ( e ) {
@@ -583,7 +603,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
583
603
for ( var i = 0 ; i < maxLines ; ++ i ) {
584
604
line = source [ lineNo - i ] + line ;
585
605
586
- if ( ! isUndefined ( line ) ) {
606
+ if ( ! ( 0 , _is . isUndefined ) ( line ) ) {
587
607
if ( ( m = reGuessFunction . exec ( line ) ) ) {
588
608
return m [ 1 ] ;
589
609
} else if ( ( m = reFunctionArgNames . exec ( line ) ) ) {
@@ -622,7 +642,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
622
642
line -= 1 ; // convert to 0-based index
623
643
624
644
for ( var i = start ; i < end ; ++ i ) {
625
- if ( ! isUndefined ( source [ i ] ) ) {
645
+ if ( ! ( 0 , _is . isUndefined ) ( source [ i ] ) ) {
626
646
context . push ( source [ i ] ) ;
627
647
}
628
648
<
10000
div class="diff-text-inner"> }
@@ -716,7 +736,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
716
736
* @memberof TraceKit.computeStackTrace
717
737
*/
718
738
function findSourceByFunctionBody ( func ) {
719
- if ( isUndefined ( window && window . document ) ) {
739
+ if ( ( 0 , _is . isUndefined ) ( window && window . document ) ) {
720
740
return ;
721
741
}
722
742
@@ -876,7 +896,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
876
896
// NOTE: It's messing out our integration tests in Karma, let's see if we can live with it – Kamil
877
897
// parts[4] = submatch[2];
878
898
// parts[5] = null; // no column when eval
879
- } else if ( i === 0 && ! parts [ 5 ] && ! isUndefined ( ex . columnNumber ) ) {
899
+ } else if ( i === 0 && ! parts [ 5 ] && ! ( 0 , _is . isUndefined ) ( ex . columnNumber ) ) {
880
900
// FireFox uses this awesome columnNumber property for its top frame
881
901
// Also note, Firefox's column number is 0-based and everything else expects 1-based,
882
902
// so adding 1
@@ -977,7 +997,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
977
997
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,
978
998
lines = stacktrace . split ( '\n' ) ,
979
999
stack = [ ] ,
980
- parts ;
1000
+ parts = void 0 ;
981
1001
982
1002
for ( var line = 0 ; line < lines . length ; line += 2 ) {
983
1003
var element = null ;
@@ -1066,7 +1086,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
1066
1086
stack = [ ] ,
1067
1087
scripts = window && window . document && window . document . getElementsByTagName ( 'script' ) ,
1068
1088
inlineScriptBlocks = [ ] ,
1069
- parts ;
1089
+ parts = void 0 ;
1070
1090
1071
1091
for ( var s in scripts ) {
1072
1092
if ( _has ( scripts , s ) && ! scripts [ s ] . src ) {
@@ -1217,9 +1237,9 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
1217
1237
stack = [ ] ,
1218
1238
funcs = { } ,
1219
1239
recursion = false ,
1220
- parts ,
1221
- item ,
1222
- source ;
1240
+ parts = void 0 ,
1241
+ item = void 0 ,
1242
+ source = void 0 ;
1223
1243
1224
1244
for ( var curr = computeStackTraceByWalkingCallerChain . caller ; curr && ! recursion ; curr = curr . caller ) {
1225
1245
if ( curr === computeStackTrace || curr === TraceKit . report ) {
@@ -1407,7 +1427,7 @@ TraceKit.extendToAsynchronousCallbacks = function() {
1407
1427
_helper ( 'setInterval' ) ;
1408
1428
} ;
1409
1429
1410
- //Default options:
1430
+ // Default options:
1411
1431
if ( ! TraceKit . remoteFetching ) {
1412
1432
TraceKit . remoteFetching = true ;
1413
1433
}
@@ -1419,9 +1439,12 @@ if (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {
1419
1439
TraceKit . linesOfContext = 11 ;
1420
1440
}
1421
1441
1422
- const subscribe = TraceKit . report . subscribe ;
1423
- const installGlobalHandler = TraceKit . report . installGlobalHandler ;
1424
- const installGlobalUnhandledRejectionHandler = TraceKit . report . installGlobalUnhandledRejectionHandler ;
1425
- const computeStackTrace = TraceKit . computeStackTrace ;
1442
+ var subscribe = TraceKit . report . subscribe ;
1443
+ var installGlobalHandler = TraceKit . report . installGlobalHandler ;
1444
+ var installGlobalUnhandledRejectionHandler = TraceKit . report . installGlobalUnhandledRejectionHandler ;
1445
+ var computeStackTrace = TraceKit . computeStackTrace ;
1426
1446
1427
- export { subscribe , installGlobalHandler , installGlobalUnhandledRejectionHandler , computeStackTrace } ;
1447
+ exports . subscribe = subscribe ;
1448
+ exports . installGlobalHandler = installGlobalHandler ;
1449
+ exports . installGlobalUnhandledRejectionHandler = installGlobalUnhandledRejectionHandler ;
1450
+ exports . computeStackTrace = computeStackTrace ;
0 commit comments