Merge pull request #10228 from morille/patch-2
Don't detect nw.js as node.js
This commit is contained in:
commit
3e342554d1
@ -15,5 +15,9 @@
|
|||||||
/* globals module, process */
|
/* globals module, process */
|
||||||
|
|
||||||
module.exports = function isNodeJS() {
|
module.exports = function isNodeJS() {
|
||||||
return typeof process === 'object' && process + '' === '[object process]';
|
// NW.js is a browser context, but copies some Node.js objects; see
|
||||||
|
// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context
|
||||||
|
return typeof process === 'object' &&
|
||||||
|
process + '' === '[object process]' &&
|
||||||
|
!process.versions['nw'];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user