refactor: add prefer-const to .eslintrc + fix errors (#14880)

This commit is contained in:
Milan Burda 2018-10-02 03:56:31 +02:00 committed by Samuel Attard
parent 07161a8452
commit 3ad3ade828
47 changed files with 239 additions and 238 deletions

View file

@ -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
}