refactor: add prefer-const to .eslintrc + fix errors (#14880)
This commit is contained in:
parent
07161a8452
commit
3ad3ade828
47 changed files with 239 additions and 238 deletions
|
@ -41,14 +41,14 @@ BrowserWindow.prototype._init = function () {
|
|||
this.webContents.on('-add-new-contents', (event, webContents, disposition,
|
||||
userGesture, left, top, width,
|
||||
height) => {
|
||||
let urlFrameName = v8Util.getHiddenValue(webContents, 'url-framename')
|
||||
const urlFrameName = v8Util.getHiddenValue(webContents, 'url-framename')
|
||||
if ((disposition !== 'foreground-tab' && disposition !== 'new-window' &&
|
||||
disposition !== 'background-tab') || !urlFrameName) {
|
||||
event.preventDefault()
|
||||
return
|
||||
}
|
||||
|
||||
let { url, frameName } = urlFrameName
|
||||
const { url, frameName } = urlFrameName
|
||||
v8Util.deleteHiddenValue(webContents, 'url-framename')
|
||||
const options = {
|
||||
show: true,
|
||||
|
@ -115,7 +115,7 @@ BrowserWindow.prototype._init = function () {
|
|||
}
|
||||
|
||||
const visibilityEvents = ['show', 'hide', 'minimize', 'maximize', 'restore']
|
||||
for (let event of visibilityEvents) {
|
||||
for (const event of visibilityEvents) {
|
||||
this.on(event, visibilityChanged)
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ BrowserWindow.getAllWindows = () => {
|
|||
}
|
||||
|
||||
BrowserWindow.getFocusedWindow = () => {
|
||||
for (let window of BrowserWindow.getAllWindows()) {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
if (window.isFocused() || window.isDevToolsFocused()) return window
|
||||
}
|
||||
return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue