Skip to content

Commit

Permalink
Comment updates (#481)
Browse files Browse the repository at this point in the history
* comment updates

* comment updates
  • Loading branch information
Casheeew authored Dec 29, 2023
1 parent c13ee62 commit d90d408
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
6 changes: 4 additions & 2 deletions ext/js/accessibility/google-docs-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
8 changes: 5 additions & 3 deletions ext/js/app/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ext/js/background/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1664,14 +1664,14 @@ 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
* @param {boolean} predicateIsAsync
* @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;
Expand Down
10 changes: 6 additions & 4 deletions ext/js/comm/clipboard-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ext/js/language/deinflector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])];
Expand Down
6 changes: 4 additions & 2 deletions ext/js/language/sandbox/japanese-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions types/ext/translation-internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit d90d408

Please sign in to comment.