fix: do not remove node globals when context isolation is enabled (#18967)

This commit is contained in:
Samuel Attard 2019-06-28 14:37:00 -07:00 committed by Shelley Vohr
parent 1d8e16bc6e
commit 6eed4a98ce

View file

@ -179,14 +179,17 @@ if (nodeIntegration) {
} }
} }
} else { } else {
// Delete Node's symbols after the Environment has been loaded. // Delete Node's symbols after the Environment has been loaded in a
process.once('loaded', function () { // non context-isolated environment
delete global.process if (!contextIsolation) {
delete global.Buffer process.once('loaded', function () {
delete global.setImmediate delete global.process
delete global.clearImmediate delete global.Buffer
delete global.global delete global.setImmediate
}) delete global.clearImmediate
delete global.global
})
}
} }
const errorUtils = require('@electron/internal/common/error-utils') const errorUtils = require('@electron/internal/common/error-utils')