summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 49afc368..498eafcd 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -140,16 +140,17 @@ function dictTermsCompressTags(definitions) {
function dictTermsGroup(definitions, dictionaries) {
const groups = {};
for (const definition of definitions) {
- const key = [definition.source, definition.expression].concat(definition.reasons);
+ const key = [definition.source, definition.expression];
+ key.push(...definition.reasons);
if (definition.reading) {
key.push(definition.reading);
}
- const group = groups[key];
- if (group) {
- group.push(definition);
+ const keyString = key.toString();
+ if (groups.hasOwnProperty(keyString)) {
+ groups[keyString].push(definition);
} else {
- groups[key] = [definition];
+ groups[keyString] = [definition];
}
}