build: enable JS semicolons (#22783)

This commit is contained in:
Samuel Attard 2020-03-20 13:28:31 -07:00 committed by GitHub
parent 24e21467b9
commit 5d657dece4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
354 changed files with 21512 additions and 21510 deletions

View file

@ -1,40 +1,40 @@
const { app, BrowserWindow, ipcMain } = require('electron')
const net = require('net')
const path = require('path')
const { app, BrowserWindow, ipcMain } = require('electron');
const net = require('net');
const path = require('path');
process.on('uncaughtException', () => {
app.exit(1)
})
app.exit(1);
});
if (process.argv.includes('--app-enable-sandbox')) {
app.enableSandbox()
app.enableSandbox();
}
let currentWindowSandboxed = false
let currentWindowSandboxed = false;
app.whenReady().then(() => {
function testWindow (isSandboxed, callback) {
currentWindowSandboxed = isSandboxed
currentWindowSandboxed = isSandboxed;
const currentWindow = new BrowserWindow({
show: false,
webPreferences: {
preload: path.join(__dirname, 'electron-app-mixed-sandbox-preload.js'),
sandbox: isSandboxed
}
})
currentWindow.loadURL('about:blank')
});
currentWindow.loadURL('about:blank');
currentWindow.webContents.once('devtools-opened', () => {
if (isSandboxed) {
argv.sandboxDevtools = true
argv.sandboxDevtools = true;
} else {
argv.noSandboxDevtools = true
argv.noSandboxDevtools = true;
}
if (callback) {
callback()
callback();
}
finish()
})
currentWindow.webContents.openDevTools()
finish();
});
currentWindow.webContents.openDevTools();
}
const argv = {
@ -42,36 +42,36 @@ app.whenReady().then(() => {
noSandbox: null,
sandboxDevtools: null,
noSandboxDevtools: null
}
};
let connected = false
let connected = false;
testWindow(true, () => {
testWindow()
})
testWindow();
});
function finish () {
if (connected && argv.sandbox != null && argv.noSandbox != null &&
argv.noSandboxDevtools != null && argv.sandboxDevtools != null) {
client.once('end', () => {
app.exit(0)
})
client.end(JSON.stringify(argv))
app.exit(0);
});
client.end(JSON.stringify(argv));
}
}
const socketPath = process.platform === 'win32' ? '\\\\.\\pipe\\electron-mixed-sandbox' : '/tmp/electron-mixed-sandbox'
const socketPath = process.platform === 'win32' ? '\\\\.\\pipe\\electron-mixed-sandbox' : '/tmp/electron-mixed-sandbox';
const client = net.connect(socketPath, () => {
connected = true
finish()
})
connected = true;
finish();
});
ipcMain.on('argv', (event, value) => {
if (currentWindowSandboxed) {
argv.sandbox = value
argv.sandbox = value;
} else {
argv.noSandbox = value
argv.noSandbox = value;
}
finish()
})
})
finish();
});
});