Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 0e19304

Browse files
committed
fix: correct declaration which breaks closure
1 parent 8f6ddf3 commit 0e19304

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: lib/common/utils.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313

1414
// Hack since TypeScript isn't compiling this for a worker.
1515
declare const WorkerGlobalScope: any;
16-
declare const window: any;
1716

1817
export const zoneSymbol: (name: string) => string = (n) => `__zone_symbol__${n}`;
19-
const _global = typeof window === 'object' && window || typeof self === 'object' && self || global;
18+
const _global: any = typeof window === 'object' && window || typeof self === 'object' && self || global;
2019

2120
export function bindArguments(args: any[], source: string): any[] {
2221
for (let i = args.length - 1; i >= 0; i--) {
@@ -50,12 +49,12 @@ export const isNode: boolean =
5049
{}.toString.call(process) === '[object process]');
5150

5251
export const isBrowser: boolean =
53-
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']);
52+
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && (window as any)['HTMLElement']);
5453

5554
// we are in electron of nw, so we are both browser and nodejs
5655
export const isMix: boolean = typeof process !== 'undefined' &&
5756
{}.toString.call(process) === '[object process]' && !isWebWorker &&
58-
!!(typeof window !== 'undefined' && window['HTMLElement']);
57+
!!(typeof window !== 'undefined' && (window as any)['HTMLElement']);
5958

6059
export function patchProperty(obj: any, prop: string) {
6160
const desc = Object.getOwnPropertyDescriptor(obj, prop) || {enumerable: true, configurable: true};

0 commit comments

Comments
 (0)