aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 766fb0ed..b489b8d2 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -45,7 +45,7 @@ async function apiOptionsSet(changedOptions, optionsContext, source) {
function modifyOption(path, value, options) {
let pivot = options;
for (const key of path.slice(0, -1)) {
- if (!pivot.hasOwnProperty(key)) {
+ if (!hasOwn(pivot, key)) {
return false;
}
pivot = pivot[key];
@@ -207,7 +207,7 @@ async function apiDefinitionsAddable(definitions, modes, optionsContext) {
}
if (cannotAdd.length > 0) {
- const noteIdsArray = await anki.findNoteIds(cannotAdd.map(e => e[0]));
+ const noteIdsArray = await anki.findNoteIds(cannotAdd.map((e) => e[0]));
for (let i = 0, ii = Math.min(cannotAdd.length, noteIdsArray.length); i < ii; ++i) {
const noteIds = noteIdsArray[i];
if (noteIds.length > 0) {
@@ -236,7 +236,7 @@ async function apiTemplateRender(template, data, dynamic) {
async function apiCommandExec(command, params) {
const handlers = apiCommandExec.handlers;
- if (handlers.hasOwnProperty(command)) {
+ if (hasOwn(handlers, command)) {
const handler = handlers[command];
handler(params);
}
@@ -404,7 +404,9 @@ async function apiGetBrowser() {
if (info.name === 'Fennec') {
return 'firefox-mobile';
}
- } catch (e) { }
+ } catch (e) {
+ // NOP
+ }
return 'firefox';
} else {
return 'chrome';