mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-26 10:00:50 +08:00
Remove warning related to 10+ year old vm compability setup
This commit is contained in:
parent
8b4f59ba49
commit
c6d29c2420
1 changed files with 8 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
||||||
window.eval = global.eval = function() {
|
window.eval = global.eval = function() {
|
||||||
throw new Error('Sorry, N1 does not support window.eval() for security reasons.');
|
throw new Error('Sorry, Mailspring does not support window.eval() for security reasons.');
|
||||||
};
|
};
|
||||||
|
|
||||||
var util = null;
|
var util = null;
|
||||||
|
@ -27,7 +27,11 @@ function handleSetupError(error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyEnvFromMainProcess() {
|
function copyEnvFromMainProcess() {
|
||||||
const newEnv = Object.assign({}, process.env, JSON.parse(JSON.stringify(require('@electron/remote').process.env)));
|
const newEnv = Object.assign(
|
||||||
|
{},
|
||||||
|
process.env,
|
||||||
|
JSON.parse(JSON.stringify(require('@electron/remote').process.env))
|
||||||
|
);
|
||||||
process.env = newEnv;
|
process.env = newEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,18 +45,9 @@ function setupWindow(loadSettings) {
|
||||||
var CompileCache = require('../src/compile-cache');
|
var CompileCache = require('../src/compile-cache');
|
||||||
CompileCache.setHomeDirectory(loadSettings.configDirPath);
|
CompileCache.setHomeDirectory(loadSettings.configDirPath);
|
||||||
|
|
||||||
setupVmCompatibility();
|
|
||||||
|
|
||||||
require(loadSettings.bootstrapScript);
|
require(loadSettings.bootstrapScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupVmCompatibility() {
|
|
||||||
var vm = require('vm');
|
|
||||||
if (!vm.Script.createContext) {
|
|
||||||
vm.Script.createContext = vm.createContext;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
try {
|
try {
|
||||||
var startTime = Date.now();
|
var startTime = Date.now();
|
||||||
|
|
Loading…
Reference in a new issue