diff options
| author | Cashew <52880648+Scrub1492@users.noreply.github.com> | 2023-12-29 10:31:45 +0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-29 03:31:45 +0000 | 
| commit | d90d408279938d389019a8bed15c5eb95af7c8bc (patch) | |
| tree | 0c81f456e3aaf853528c51b0d85ae54fcde05412 | |
| parent | c13ee62b84693346e28741d7f016c6700a2c27d4 (diff) | |
Comment updates (#481)
* comment updates
* comment updates
| -rw-r--r-- | ext/js/accessibility/google-docs-util.js | 6 | ||||
| -rw-r--r-- | ext/js/app/frontend.js | 8 | ||||
| -rw-r--r-- | ext/js/background/backend.js | 2 | ||||
| -rw-r--r-- | ext/js/comm/clipboard-monitor.js | 10 | ||||
| -rw-r--r-- | ext/js/language/deinflector.js | 2 | ||||
| -rw-r--r-- | ext/js/language/sandbox/japanese-util.js | 6 | ||||
| -rw-r--r-- | types/ext/translation-internal.d.ts | 14 | 
7 files changed, 28 insertions, 20 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, diff --git a/types/ext/translation-internal.d.ts b/types/ext/translation-internal.d.ts index 784a5979..5845b45d 100644 --- a/types/ext/translation-internal.d.ts +++ b/types/ext/translation-internal.d.ts @@ -40,13 +40,13 @@ export type TextDeinflectionOptionsArrays = [  export enum DeinflectionRuleFlags {      None = 0x0, -    VerbIchidan = 0b00000001, // Verb ichidan -    VerbGodan = 0b00000010, // Verb godan -    VerbSuru = 0b00000100, // Verb suru -    VerbKuru = 0b00001000, // Verb kuru -    VerbZuru = 0b00010000, // Verb zuru -    AdjectiveI = 0b00100000, // Adjective i -    IruEndingIntermediate = 0b01000000, // Intermediate -iru endings for progressive or perfect tense +    VerbIchidan = 0b00000001, +    VerbGodan = 0b00000010, +    VerbSuru = 0b00000100, +    VerbKuru = 0b00001000, +    VerbZuru = 0b00010000, +    AdjectiveI = 0b00100000, +    IruEndingIntermediate = 0b01000000,  }  export type Deinflection = { |