@@ -68,46 +68,8 @@ export interface InternalGlobal {
68
68
_sentryModuleMetadata ?: Record < string , any > ;
69
69
}
70
70
71
- // The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification
72
- // https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js
73
- // core-js has the following licence:
74
- //
75
- // Copyright (c) 2014-2022 Denis Pushkarev
76
- //
77
- // Permission is hereby granted, free of charge, to any person obtaining a copy
78
- // of this software and associated documentation files (the "Software"), to deal
79
- // in the Software without restriction, including without limitation the rights
80
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81
- // copies of the Software, and to permit persons to whom the Software is
82
- // furnished to do so, subject to the following conditions:
83
- //
84
- // The above copyright notice and this permission notice shall be included in
85
- // all copies or substantial portions of the Software.
86
- //
87
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
93
- // THE SOFTWARE.
94
-
95
- /** Returns 'obj' if it's the global object, otherwise returns undefined */
96
- function isGlobalObj ( obj : { Math ?: Math } ) : any | undefined {
97
- return obj && obj . Math == Math ? obj : undefined ;
98
- }
99
-
100
71
/** Get's the global object for the current JavaScript runtime */
101
- export const GLOBAL_OBJ : InternalGlobal =
102
- ( typeof globalThis == 'object' && isGlobalObj ( globalThis ) ) ||
103
- // eslint-disable-next-line no-restricted-globals
104
- ( typeof window == 'object' && isGlobalObj ( window ) ) ||
105
- ( typeof self == 'object' && isGlobalObj ( self ) ) ||
106
- ( typeof global == 'object' && isGlobalObj ( global ) ) ||
107
- ( function ( this : any ) {
108
- return this ;
109
- } ) ( ) ||
110
- { } ;
72
+ export const GLOBAL_OBJ = globalThis as unknown as InternalGlobal ;
111
73
112
74
/**
113
75
* Returns a global singleton contained in the global `__SENTRY__` object.
0 commit comments