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
|
@ -51,7 +51,7 @@ class ObjectsRegistry {
|
|||
// then garbage collected in old page).
|
||||
remove (webContents, contextId, id) {
|
||||
const ownerKey = getOwnerKey(webContents, contextId)
|
||||
let owner = this.owners[ownerKey]
|
||||
const owner = this.owners[ownerKey]
|
||||
if (owner) {
|
||||
// Remove the reference in owner.
|
||||
owner.delete(id)
|
||||
|
@ -63,10 +63,10 @@ class ObjectsRegistry {
|
|||
// Clear all references to objects refrenced by the WebContents.
|
||||
clear (webContents, contextId) {
|
||||
const ownerKey = getOwnerKey(webContents, contextId)
|
||||
let owner = this.owners[ownerKey]
|
||||
const owner = this.owners[ownerKey]
|
||||
if (!owner) return
|
||||
|
||||
for (let id of owner) this.dereference(id)
|
||||
for (const id of owner) this.dereference(id)
|
||||
|
||||
delete this.owners[ownerKey]
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class ObjectsRegistry {
|
|||
|
||||
// Private: Dereference the object from store.
|
||||
dereference (id) {
|
||||
let pointer = this.storage[id]
|
||||
const pointer = this.storage[id]
|
||||
if (pointer == null) {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue