mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix eslint warnings
This commit is contained in:
parent
7d321c0a11
commit
e8ab556411
1 changed files with 13 additions and 12 deletions
|
|
@ -19,17 +19,14 @@
|
|||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
/* global indexedDB */
|
||||
|
||||
'use strict';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
import * as s14e from './s14e-serializer.js';
|
||||
|
||||
import lz4Codec from './lz4.js';
|
||||
import { ubolog } from './console.js';
|
||||
import webext from './webext.js';
|
||||
import µb from './background.js';
|
||||
import { ubolog } from './console.js';
|
||||
import * as s14e from './s14e-serializer.js';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
|
@ -47,6 +44,10 @@ const keysFromGetArg = arg => {
|
|||
|
||||
let fastCache = 'indexedDB';
|
||||
|
||||
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
||||
const hasOwnProperty = (o, p) =>
|
||||
Object.prototype.hasOwnProperty.call(o, p);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Extension storage
|
||||
|
|
@ -65,7 +66,7 @@ const cacheStorage = (( ) => {
|
|||
if ( found.length === wanted.length ) { return; }
|
||||
const missing = [];
|
||||
for ( const key of wanted ) {
|
||||
if ( outbin.hasOwnProperty(key) ) { continue; }
|
||||
if ( hasOwnProperty(outbin, key) ) { continue; }
|
||||
missing.push(key);
|
||||
}
|
||||
return missing;
|
||||
|
|
@ -107,7 +108,7 @@ const cacheStorage = (( ) => {
|
|||
if ( argbin instanceof Object === false ) { return; }
|
||||
if ( Array.isArray(argbin) ) { return; }
|
||||
for ( const key of wanted ) {
|
||||
if ( argbin.hasOwnProperty(key) === false ) { continue; }
|
||||
if ( hasOwnProperty(argbin, key) === false ) { continue; }
|
||||
outbin[key] = argbin[key];
|
||||
}
|
||||
}).then(( ) => {
|
||||
|
|
@ -165,7 +166,7 @@ const cacheStorage = (( ) => {
|
|||
},
|
||||
|
||||
select(api) {
|
||||
if ( cacheAPIs.hasOwnProperty(api) === false ) { return fastCache; }
|
||||
if ( hasOwnProperty(cacheAPIs, api) === false ) { return fastCache; }
|
||||
fastCache = api;
|
||||
for ( const k of Object.keys(cacheAPIs) ) {
|
||||
if ( k === api ) { continue; }
|
||||
|
|
@ -591,7 +592,7 @@ const idbStorage = (( ) => {
|
|||
const transaction = db.transaction(STORAGE_NAME, 'readonly');
|
||||
transaction.oncomplete =
|
||||
transaction.onerror =
|
||||
transaction.onabort = ( ) => {
|
||||
transaction.onabort = ( ) => {
|
||||
resolve(Promise.all(entries));
|
||||
};
|
||||
const table = transaction.objectStore(STORAGE_NAME);
|
||||
|
|
@ -673,7 +674,7 @@ const idbStorage = (( ) => {
|
|||
}
|
||||
if ( argbin instanceof Object && Array.isArray(argbin) === false ) {
|
||||
for ( const key of keys ) {
|
||||
if ( outbin.hasOwnProperty(key) ) { continue; }
|
||||
if ( hasOwnProperty(outbin, key) ) { continue; }
|
||||
outbin[key] = argbin[key];
|
||||
}
|
||||
}
|
||||
|
|
@ -695,7 +696,7 @@ const idbStorage = (( ) => {
|
|||
},
|
||||
|
||||
clear() {
|
||||
return getDb().then(db => {
|
||||
return getDb().then(db => {
|
||||
if ( db === null ) { return; }
|
||||
db.close();
|
||||
indexedDB.deleteDatabase(STORAGE_NAME);
|
||||
|
|
|
|||
Loading…
Reference in a new issue