@@ -38,11 +38,7 @@ var _is = require('@sentry/utils/is');
38
38
var window =
39
39
typeof window !== 'undefined'
40
40
? window
41
- : typeof global !== 'undefined'
42
- ? global
43
- : typeof self !== 'undefined'
44
- ? self
45
- : { } ;
41
+ : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : { } ;
46
42
47
43
var TraceKit = { } ;
48
44
var _oldTraceKit = window . TraceKit ;
@@ -635,7 +631,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
635
631
// *before* the offending line.
636
632
linesBefore = Math . floor ( TraceKit . linesOfContext / 2 ) ,
637
633
// Add one extra line if linesOfContext is odd
638
- linesAfter = linesBefore + ( TraceKit . linesOfContext % 2 ) ,
634
+ linesAfter = linesBefore + TraceKit . linesOfContext % 2 ,
639
635
start = Math . max ( 0 , line - linesBefore - 1 ) ,
640
636
end = Math . min ( source . length , line + linesAfter - 1 ) ;
641
637
@@ -759,11 +755,9 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
759
755
760
756
if ( ! ( parts = codeRE . exec ( code ) ) ) {
761
757
re = new RegExp ( escapeRegExp ( code ) . replace ( / \s + / g, '\\s+' ) ) ;
762
- }
763
-
764
- // not sure if this is really necessary, but I don’t have a test
765
- // corpus large enough to confirm that and it was in the original.
766
- else {
758
+ } else {
759
+ // not sure if this is really necessary, but I don’t have a test
760
+ // corpus large enough to confirm that and it was in the original.
767
761
var name = parts [ 1 ] ? '\\s+' + parts [ 1 ] : '' ,
768
762
args = parts [ 2 ] . split ( ',' ) . join ( '\\s*,\\s*' ) ;
769
763
@@ -918,7 +912,12 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
918
912
element . func = guessFunctionName ( element . url , element . line ) ;
919
913
}
920
914
921
- if ( element . url && element . url . substr ( 0 , 5 ) === 'blob:' ) {
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:' ) {
922
921
// Special case for handling JavaScript loaded into a blob.
923
922
// We use a synchronous AJAX request here as a blob is already in
924
923
// memory - it's not making a network request. This will generate a warning
0 commit comments