@@ -38,7 +38,11 @@ var _is = require('@sentry/utils/is');
38
38
var window =
39
39
typeof window !== 'undefined'
40
40
? window
41
- : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : { } ;
41
+ : typeof global !== 'undefined'
42
+ ? global
43
+ : typeof self !== 'undefined'
44
+ ? self
45
+ : { } ;
42
46
43
47
var TraceKit = { } ;
44
48
var _oldTraceKit = window . TraceKit ;
@@ -631,7 +635,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
631
635
// *before* the offending line.
632
636
linesBefore = Math . floor ( TraceKit . linesOfContext / 2 ) ,
633
637
// Add one extra line if linesOfContext is odd
634
- linesAfter = linesBefore + TraceKit . linesOfContext % 2 ,
638
+ linesAfter = linesBefore + ( TraceKit . linesOfContext % 2 ) ,
635
639
start = Math . max ( 0 , line - linesBefore - 1 ) ,
636
640
end = Math . min ( source . length , line + linesAfter - 1 ) ;
637
641
@@ -912,12 +916,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
912
916
element . func = guessFunctionName ( element . url , element . line ) ;
913
917
}
914
918
915
- // NOTE: This feature has been turned off for now, as it produces deprecation warning
916
- // due to usage of synchronous XMLHttpRequest. And because we use ReportingObserver API
917
- // to report deprecations, we'd report ourselves...
918
- // We can re-enable this feature once we migrate Tracekit to async-oriented code
919
- // and we'll be able to await for the request to come back with the blob
920
- if ( false && element . url && element . url . substr ( 0 , 5 ) === 'blob:' ) {
919
+ if ( TraceKit . remoteFetching && element . url && element . url . substr ( 0 , 5 ) === 'blob:' ) {
921
920
// Special case for handling JavaScript loaded into a blob.
922
921
// We use a synchronous AJAX request here as a blob is already in
923
922
// memory - it's not making a network request. This will generate a warning
@@ -1426,17 +1425,10 @@ TraceKit.extendToAsynchronousCallbacks = function() {
1426
1425
_helper ( 'setInterval' ) ;
1427
1426
} ;
1428
1427
1429
- // Default options:
1430
- if ( ! TraceKit . remoteFetching ) {
1431
- TraceKit . remoteFetching = true ;
1432
- }
1433
- if ( ! TraceKit . collectWindowErrors ) {
1434
- TraceKit . collectWindowErrors = true ;
1435
- }
1436
- if ( ! TraceKit . linesOfContext || TraceKit . linesOfContext < 1 ) {
1437
- // 5 lines before, the offending line, 5 lines after
1438
- TraceKit . linesOfContext = 11 ;
1439
- }
1428
+ TraceKit . remoteFetching = false ;
1429
+ TraceKit . collectWindowErrors = true ;
1430
+ // 5 lines before, the offending line, 5 lines after
1431
+ TraceKit . linesOfContext = 11 ;
1440
1432
1441
1433
var subscribe = TraceKit . report . subscribe ;
1442
1434
var installGlobalHandler = TraceKit . report . installGlobalHandler ;
0 commit comments