aboutsummaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/accessibility/google-docs-util.js6
-rw-r--r--ext/js/app/frontend.js8
-rw-r--r--ext/js/background/backend.js2
-rw-r--r--ext/js/comm/clipboard-monitor.js10
-rw-r--r--ext/js/language/deinflector.js2
-rw-r--r--ext/js/language/sandbox/japanese-util.js6
6 files changed, 21 insertions, 13 deletions
diff --git a/ext/js/accessibility/google-docs-util.js b/ext/js/accessibility/google-docs-util.js
index 151b6340..cc6cbd69 100644
--- a/ext/js/accessibility/google-docs-util.js
+++ b/ext/js/accessibility/google-docs-util.js
@@ -49,11 +49,13 @@ export class GoogleDocsUtil {
}
/**
+ * Gets this <style> node, or creates one if it doesn't exist.
+ *
+ * A <style> node is necessary to force the SVG <rect> elements to have a fill,
+ * which allows them to be included in document.elementsFromPoint's return value.
* @returns {HTMLStyleElement}
*/
static _getStyleNode() {
- // This <style> node is necessary to force the SVG <rect> elements to have a fill,
- // which allows them to be included in document.elementsFromPoint's return value.
if (typeof this._styleNode === 'undefined') {
const style = document.createElement('style');
style.textContent = [
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js
index b093ec33..e386bf64 100644
--- a/ext/js/app/frontend.js
+++ b/ext/js/app/frontend.js
@@ -552,9 +552,11 @@ export class Frontend {
}
}
- // The token below is used as a unique identifier to ensure that a new _updatePopup call
- // hasn't been started during the await.
- /** @type {?import('core').TokenObject} */
+ /**
+ * The token below is used as a unique identifier to ensure that a new _updatePopup call
+ * hasn't been started during the await.
+ * @type {?import('core').TokenObject}
+ */
const token = {};
this._updatePopupToken = token;
const popup = await popupPromise;
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index b523cd6e..481567b5 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -1664,6 +1664,7 @@ export class Backend {
}
/**
+ * This function works around the need to have the "tabs" permission to access tab.url.
* @param {number} timeout
* @param {boolean} multiple
* @param {import('backend').FindTabsPredicate} predicate
@@ -1671,7 +1672,6 @@ export class Backend {
* @returns {Promise<import('backend').TabInfo[]|(?import('backend').TabInfo)>}
*/
async _findTabs(timeout, multiple, predicate, predicateIsAsync) {
- // This function works around the need to have the "tabs" permission to access tab.url.
const tabs = await this._getAllTabs();
let done = false;
diff --git a/ext/js/comm/clipboard-monitor.js b/ext/js/comm/clipboard-monitor.js
index d717dff2..b870a7a0 100644
--- a/ext/js/comm/clipboard-monitor.js
+++ b/ext/js/comm/clipboard-monitor.js
@@ -47,11 +47,13 @@ export class ClipboardMonitor extends EventDispatcher {
start() {
this.stop();
- // The token below is used as a unique identifier to ensure that a new clipboard monitor
- // hasn't been started during the await call. The check below the await call
- // will exit early if the reference has changed.
let canChange = false;
- /** @type {?import('core').TokenObject} */
+ /**
+ * This token is used as a unique identifier to ensure that a new clipboard monitor
+ * hasn't been started during the await call. The check below the await call
+ * will exit early if the reference has changed.
+ * @type {?import('core').TokenObject}
+ */
const token = {};
const intervalCallback = async () => {
this._timerId = null;
diff --git a/ext/js/language/deinflector.js b/ext/js/language/deinflector.js
index f0e02f6f..d2d92e53 100644
--- a/ext/js/language/deinflector.js
+++ b/ext/js/language/deinflector.js
@@ -50,7 +50,7 @@ export class Deinflector {
* @example
* const deinflector = new Deinflector(deinflectionReasons);
* // [{ term: '食べた', rules: 0, reasons: [] }, { term: '食べる', rules: 1, reasons: ['past'] }, { term: '食ぶ', rules: 2, reasons: ['potential', 'past'] }]
- * console.log(deinflector.deinflect('食べさせられる'));
+ * console.log(deinflector.deinflect('食べた'));
*/
deinflect(source) {
const results = [this._createDeinflection(source, 0, [])];
diff --git a/ext/js/language/sandbox/japanese-util.js b/ext/js/language/sandbox/japanese-util.js
index 7d9413a6..f5fc1c86 100644
--- a/ext/js/language/sandbox/japanese-util.js
+++ b/ext/js/language/sandbox/japanese-util.js
@@ -66,8 +66,10 @@ const CJK_IDEOGRAPH_RANGES = [
CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_RANGE
];
-// Japanese character ranges, roughly ordered in order of expected frequency
-/** @type {import('japanese-util').CodepointRange[]} */
+/**
+ * Japanese character ranges, roughly ordered in order of expected frequency.
+ * @type {import('japanese-util').CodepointRange[]}
+ */
const JAPANESE_RANGES = [
HIRAGANA_RANGE,
KATAKANA_RANGE,