rpc: use globalThis rather than global

This commit is contained in:
Koushik Dutta
2024-08-03 10:21:49 -07:00
parent 465189f4b8
commit a2bbb67670

View File

@@ -1,10 +1,10 @@
export function startPeriodicGarbageCollection() {
if (!global.gc) {
if (!globalThis.gc) {
console.warn('rpc peer garbage collection not available: global.gc is not exposed.');
}
let g: typeof global;
let g: typeof globalThis;
try {
g = global;
g = globalThis;
}
catch (e) {
}