aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-28 18:46:15 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-28 18:46:15 -0800
commit8efe5b1fbf6bf1539c93f25b6b87918c1a651f00 (patch)
tree6d407c4dc5dcb6d93ad38c10f2721d5d24ddd2a3 /ext/bg/js/translator.js
parentbf9925ec9cabd5a755152aa89df1f87e38d53534 (diff)
workaround for broken const in firefox
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index e7c2aac2..82dffd91 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -54,8 +54,8 @@ class Translator {
}
}).then(deinflections => {
let definitions = [];
- for (const deinflection of deinflections) {
- for (const definition of deinflection.definitions) {
+ for (let deinflection of deinflections) {
+ for (let definition of deinflection.definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
tags.push(buildDictTag(definition.dictionary));
definitions.push({
@@ -76,7 +76,7 @@ class Translator {
definitions = sortTermDefs(definitions, dictionaries);
let length = 0;
- for (const definition of definitions) {
+ for (let definition of definitions) {
length = Math.max(length, definition.source.length);
}
@@ -95,7 +95,7 @@ class Translator {
const processed = {};
const promises = [];
- for (const c of text) {
+ for (let c of text) {
if (!processed[c]) {
promises.push(this.database.findKanji(c, titles));
processed[c] = true;
@@ -104,7 +104,7 @@ class Translator {
return Promise.all(promises).then(defSets => {
const definitions = defSets.reduce((a, b) => a.concat(b), []);
- for (const definition of definitions) {
+ for (let definition of definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
tags.push(buildDictTag(definition.dictionary));
definition.tags = sortTags(tags);
@@ -130,7 +130,7 @@ class Translator {
return Promise.all(promises).then(results => {
let deinflections = [];
- for (const result of results) {
+ for (let result of results) {
deinflections = deinflections.concat(result);
}
@@ -139,7 +139,7 @@ class Translator {
}
processKanji(definitions) {
- for (const definition of definitions) {
+ for (let definition of definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
definition.tags = sortTags(tags);
}