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

Commit

Permalink
fix: correct declaration which breaks closure
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Mar 15, 2017
1 parent 8f6ddf3 commit 0e19304
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

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

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

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

export const isBrowser: boolean =
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']);
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && (window as any)['HTMLElement']);

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

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

0 comments on commit 0e19304

Please sign in to comment.