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

Commit 486010b

Browse files
adrosmhevery
authored andcommitted
fix: support nw.js environment
Closes #524 'isNode' will now be false in nw.js environment so 'isBrowser' will be true and 'propertyDescriptorPatch' will be executed correctly
1 parent 9509747 commit 486010b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/common/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const isWebWorker: boolean =
4545
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);
4646

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

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

0 commit comments

Comments
 (0)