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,6 +1,6 @@
import { expect } from 'chai'
import { BrowserWindow } from 'electron'
import { emittedOnce } from './events-helpers'
import { expect } from 'chai';
import { BrowserWindow } from 'electron';
import { emittedOnce } from './events-helpers';
async function ensureWindowIsClosed (window: BrowserWindow | null) {
if (window && !window.isDestroyed()) {
@ -10,14 +10,14 @@ async function ensureWindowIsClosed (window: BrowserWindow | null) {
// <webview> children which need to be destroyed first. In that case, we
// await the 'closed' event which signals the complete shutdown of the
// window.
const isClosed = emittedOnce(window, 'closed')
window.destroy()
await isClosed
const isClosed = emittedOnce(window, 'closed');
window.destroy();
await isClosed;
} else {
// If there's no WebContents or if the WebContents is already destroyed,
// then the 'closed' event has already been emitted so there's nothing to
// wait for.
window.destroy()
window.destroy();
}
}
}
@ -26,22 +26,22 @@ export const closeWindow = async (
window: BrowserWindow | null = null,
{ assertNotWindows } = { assertNotWindows: true }
) => {
await ensureWindowIsClosed(window)
await ensureWindowIsClosed(window);
if (assertNotWindows) {
const windows = BrowserWindow.getAllWindows()
const windows = BrowserWindow.getAllWindows();
try {
expect(windows).to.have.lengthOf(0)
expect(windows).to.have.lengthOf(0);
} finally {
for (const win of windows) {
await ensureWindowIsClosed(win)
await ensureWindowIsClosed(win);
}
}
}
}
};
export async function closeAllWindows () {
for (const w of BrowserWindow.getAllWindows()) {
await closeWindow(w, { assertNotWindows: false })
await closeWindow(w, { assertNotWindows: false });
}
}