Skip to content

Commit

Permalink
refactor(zone.js): fix incompatiblity with JSCompiler checks
Browse files Browse the repository at this point in the history
this commit updates the code which causes the error
[JSC_UNDEFINED_VARIABLE] variable global is undeclared
  • Loading branch information
atscott committed Feb 14, 2025
1 parent 6789c7e commit 9bd93f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/zone.js/lib/zone-spec/async-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import {__symbol__, ZoneType} from '../zone-impl';

const __global: any =
(typeof window !== 'undefined' && window) || (typeof self !== 'undefined' && self) || global;
(typeof window !== 'undefined' && window) ||
(typeof self !== 'undefined' && self) ||
globalThis.global;
class AsyncTestZoneSpec implements ZoneSpec {
// Needs to be a getter and not a plain property in order run this just-in-time. Otherwise
// `__symbol__` would be evaluated during top-level execution prior to the Zone prefix being
Expand Down
2 changes: 1 addition & 1 deletion packages/zone.js/lib/zone-spec/wtf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import {ZoneType} from '../zone-impl';

const _global: any =
(typeof window === 'object' && window) || (typeof self === 'object' && self) || global;
(typeof window === 'object' && window) || (typeof self === 'object' && self) || globalThis.global;

export function patchWtf(Zone: ZoneType): void {
interface Wtf {
Expand Down

0 comments on commit 9bd93f4

Please sign in to comment.