aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary-importer.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-06-28 17:24:06 -0400
committerGitHub <noreply@github.com>2020-06-28 17:24:06 -0400
commit441c23bf3be1bc4f14e17ec3956a8c90b1a674e8 (patch)
tree2ff8aef4f401f333df2d487814b741a005ca35d3 /ext/bg/js/dictionary-importer.js
parent7590055d4e809ab857b2d491dab256e66f1b34b6 (diff)
Rename Database to DictionaryDatabase (#633)
Diffstat (limited to 'ext/bg/js/dictionary-importer.js')
-rw-r--r--ext/bg/js/dictionary-importer.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/dictionary-importer.js b/ext/bg/js/dictionary-importer.js
index 10e30cec..12f3129d 100644
--- a/ext/bg/js/dictionary-importer.js
+++ b/ext/bg/js/dictionary-importer.js
@@ -27,11 +27,11 @@ class DictionaryImporter {
this._schemas = new Map();
}
- async import(database, archiveSource, details, onProgress) {
- if (!database) {
+ async import(dictionaryDatabase, archiveSource, details, onProgress) {
+ if (!dictionaryDatabase) {
throw new Error('Invalid database');
}
- if (!database.isPrepared()) {
+ if (!dictionaryDatabase.isPrepared()) {
throw new Error('Database is not ready');
}
@@ -60,7 +60,7 @@ class DictionaryImporter {
}
// Verify database is not already imported
- if (await database.dictionaryExists(dictionaryTitle)) {
+ if (await dictionaryDatabase.dictionaryExists(dictionaryTitle)) {
throw new Error('Dictionary is already imported');
}
@@ -168,7 +168,7 @@ class DictionaryImporter {
// Add dictionary
const summary = this._createSummary(dictionaryTitle, version, index, {prefixWildcardsSupported});
- database.bulkAdd('dictionaries', [summary], 0, 1);
+ dictionaryDatabase.bulkAdd('dictionaries', [summary], 0, 1);
// Add data
const errors = [];
@@ -188,7 +188,7 @@ class DictionaryImporter {
const count = Math.min(maxTransactionLength, ii - i);
try {
- await database.bulkAdd(objectStoreName, entries, i, count);
+ await dictionaryDatabase.bulkAdd(objectStoreName, entries, i, count);
} catch (e) {
errors.push(errorToJson(e));
}