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

Commit

Permalink
fix: support nw.js environment
Browse files Browse the repository at this point in the history
Closes  #524

'isNode' will now be false in nw.js environment so 'isBrowser' will be true and 'propertyDescriptorPatch' will be executed correctly
  • Loading branch information
adros authored and mhevery committed Dec 18, 2016
1 parent 9509747 commit 486010b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const isWebWorker: boolean =
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);

export const isNode: boolean =
(typeof process !== 'undefined' && {}.toString.call(process) === '[object process]');
(!('nw' in _global) && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]');

export const isBrowser: boolean =
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']);
Expand Down Expand Up @@ -429,4 +429,4 @@ export function patchMethod(
proto[name] = createNamedFn(name, patchFn(delegate, delegateName, name));
}
return delegate;
}
}

0 comments on commit 486010b

Please sign in to comment.