From b336ab3a9a0a2ac9a569ae217b506ceeeab6fda0 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Mon, 11 Nov 2019 01:43:35 +0200 Subject: [PATCH] use const --- ext/bg/js/api.js | 4 ++-- ext/bg/js/search-query-parser.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 967bded7..40e9b6d2 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -86,9 +86,9 @@ async function apiTextParse(text, optionsContext) { const results = []; while (text) { const term = []; - let [definitions, sourceLength] = await translator.findTerms(text, {}, options); + const [definitions, sourceLength] = await translator.findTerms(text, {}, options); if (definitions.length > 0) { - definitions = dictTermsSort(definitions); + dictTermsSort(definitions); const {expression, reading} = definitions[0]; const source = text.slice(0, sourceLength); for (const {text, furigana} of jpDistributeFuriganaInflected(expression, reading, source)) { diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js index 2e17688e..f8e53963 100644 --- a/ext/bg/js/search-query-parser.js +++ b/ext/bg/js/search-query-parser.js @@ -113,9 +113,9 @@ class QueryParser { this.queryParser.innerHTML = contents.join('
'); - this.queryParser.querySelectorAll('.query-parser-char').forEach((charElement) => { + for (const charElement of this.queryParser.querySelectorAll('.query-parser-char')) { this.activateScanning(charElement); - }); + } this.search.setSpinnerVisible(false); } @@ -133,9 +133,9 @@ class QueryParser { preview: true }); - this.queryParser.querySelectorAll('.query-parser-char').forEach((charElement) => { + for (const charElement of this.queryParser.querySelectorAll('.query-parser-char')) { this.activateScanning(charElement); - }); + } } activateScanning(element) {