diff options
author | Cashew <52880648+Scrub1492@users.noreply.github.com> | 2023-12-20 21:36:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 12:36:27 +0000 |
commit | 229f04ba358b3485fa7952088e03dad9e651bb23 (patch) | |
tree | dfb4a0431368e2067d7e6f5d9ce08bf88e1730cd /ext/js/comm/mecab.js | |
parent | 8b943cc97fab890085448122e7c13dd035d0e238 (diff) |
rename variables (#409)
* rename variables
* add comment to ambiguous variable
* rename variables
* add comments
* rename functions
Diffstat (limited to 'ext/js/comm/mecab.js')
-rw-r--r-- | ext/js/comm/mecab.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/js/comm/mecab.js b/ext/js/comm/mecab.js index 0a87463b..6d0f3f40 100644 --- a/ext/js/comm/mecab.js +++ b/ext/js/comm/mecab.js @@ -105,7 +105,7 @@ export class Mecab { */ async getVersion() { try { - await this._setupPort(); + await this._setupPortWrapper(); } catch (e) { // NOP } @@ -132,7 +132,7 @@ export class Mecab { * @returns {Promise<import('mecab').ParseResult[]>} A collection of parsing results of the text. */ async parseText(text) { - await this._setupPort(); + await this._setupPortWrapper(); const rawResults = await this._invoke('parse_text', {text}); // Note: The format of rawResults is not validated return this._convertParseTextResults(/** @type {import('mecab').ParseResultRaw} */ (rawResults)); @@ -225,12 +225,12 @@ export class Mecab { /** * @returns {Promise<void>} */ - async _setupPort() { + async _setupPortWrapper() { if (!this._enabled) { throw new Error('MeCab not enabled'); } if (this._setupPortPromise === null) { - this._setupPortPromise = this._setupPort2(); + this._setupPortPromise = this._setupPort(); } try { await this._setupPortPromise; @@ -242,7 +242,7 @@ export class Mecab { /** * @returns {Promise<void>} */ - async _setupPort2() { + async _setupPort() { const port = chrome.runtime.connectNative('yomitan_mecab'); this._eventListeners.addListener(port.onMessage, this._onMessage.bind(this)); this._eventListeners.addListener(port.onDisconnect, this._onDisconnect.bind(this)); |