Merge pull request #7978 from electron/memoize-no-asar-env-check

Memoize ELECTRON_NO_ASAR env var check
This commit is contained in:
Kevin Sawicki 2016-11-16 07:41:48 -08:00 committed by GitHub
commit bee5ced8f4

View file

@ -10,14 +10,9 @@
// Cache asar archive objects.
const cachedArchives = {}
const envNoAsar = process.env.ELECTRON_NO_ASAR && process.type !== 'browser' && process.type !== 'renderer'
const isAsarDisabled = function () {
if (process.noAsar) {
return true
}
if (process.env.ELECTRON_NO_ASAR && process.type !== 'browser' && process.type !== 'renderer') {
return true
}
return false
return process.noAsar || envNoAsar
}
const getOrCreateArchive = function (p) {