Skip to content

Commit ba9a0f4

Browse files
authored
ref(v8): Remove getGlobalObject utility method (#11372)
One more thing to remove...!
1 parent 9fa6c44 commit ba9a0f4

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

packages/eslint-config-sdk/src/base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ module.exports = {
111111
{
112112
name: 'window',
113113
message:
114-
'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.',
114+
'Some global variables are not available in environments like WebWorker or Node.js. Use GLOBAL_OBJ instead.',
115115
},
116116
{
117117
name: 'document',
118118
message:
119-
'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.',
119+
'Some global variables are not available in environments like WebWorker or Node.js. Use GLOBAL_OBJ instead.',
120120
},
121121
{
122122
name: 'location',
123123
message:
124-
'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.',
124+
'Some global variables are not available in environments like WebWorker or Node.js. Use GLOBAL_OBJ instead.',
125125
},
126126
{
127127
name: 'navigator',
128128
message:
129-
'Some global variables are not available in environments like WebWorker or Node.js. Use getGlobalObject() instead.',
129+
'Some global variables are not available in environments like WebWorker or Node.js. Use GLOBAL_OBJ instead.',
130130
},
131131
],
132132

packages/utils/src/browser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { isString } from './is';
2-
import { getGlobalObject } from './worldwide';
2+
import { GLOBAL_OBJ } from './worldwide';
33

4-
// eslint-disable-next-line deprecation/deprecation
5-
const WINDOW = getGlobalObject<Window>();
4+
const WINDOW = GLOBAL_OBJ as unknown as Window;
65

76
const DEFAULT_MAX_STRING_LENGTH = 80;
87

packages/utils/src/supports.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { DEBUG_BUILD } from './debug-build';
22
import { logger } from './logger';
3-
import { getGlobalObject } from './worldwide';
3+
import { GLOBAL_OBJ } from './worldwide';
44

5-
// eslint-disable-next-line deprecation/deprecation
6-
const WINDOW = getGlobalObject<Window>();
5+
const WINDOW = GLOBAL_OBJ as unknown as Window;
76

87
declare const EdgeRuntime: string | undefined;
98

packages/utils/src/vendor/supportsHistory.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
import { getGlobalObject } from '../worldwide';
24+
import { GLOBAL_OBJ } from '../worldwide';
2525

26-
// eslint-disable-next-line deprecation/deprecation
27-
const WINDOW = getGlobalObject<Window>();
26+
const WINDOW = GLOBAL_OBJ as unknown as Window;
2827

2928
/**
3029
* Tells whether current environment supports History API

packages/utils/src/worldwide.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ export const GLOBAL_OBJ: InternalGlobal =
111111
})() ||
112112
{};
113113

114-
/**
115-
* @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8
116-
*/
117-
export function getGlobalObject<T>(): T & InternalGlobal {
118-
return GLOBAL_OBJ as T & InternalGlobal;
119-
}
120-
121114
/**
122115
* Returns a global singleton contained in the global `__SENTRY__` object.
123116
*

0 commit comments

Comments
 (0)