Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment updates #481

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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