build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue