chore: remove sort comments (#12237)

This commit is contained in:
Nikolay Vitkov 2024-04-08 19:58:29 +02:00 committed by GitHub
parent 5143b31ff9
commit 60e15fe5c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 9 additions and 56 deletions

View File

@ -51,20 +51,17 @@ export class Browser extends EventEmitter<{
return browser;
}
// keep-sorted start
#closed = false;
#reason: string | undefined;
readonly #disposables = new DisposableStack();
readonly #userContexts = new Map<string, UserContext>();
readonly session: Session;
readonly #sharedWorkers = new Map<string, SharedWorkerRealm>();
// keep-sorted end
private constructor(session: Session) {
super();
// keep-sorted start
this.session = session;
// keep-sorted end
}
async #initialize() {
@ -141,7 +138,6 @@ export class Browser extends EventEmitter<{
return userContext;
}
// keep-sorted start block=yes
get closed(): boolean {
return this.#closed;
}
@ -158,7 +154,6 @@ export class Browser extends EventEmitter<{
get userContexts(): Iterable<UserContext> {
return this.#userContexts.values();
}
// keep-sorted end
@inertIfDisposed
dispose(reason?: string, closed = false): void {

View File

@ -129,7 +129,6 @@ export class BrowsingContext extends EventEmitter<{
return browsingContext;
}
// keep-sorted start
#navigation: Navigation | undefined;
#reason?: string;
#url: string;
@ -141,7 +140,6 @@ export class BrowsingContext extends EventEmitter<{
readonly id: string;
readonly parent: BrowsingContext | undefined;
readonly userContext: UserContext;
// keep-sorted end
private constructor(
context: UserContext,
@ -150,12 +148,11 @@ export class BrowsingContext extends EventEmitter<{
url: string
) {
super();
// keep-sorted start
this.#url = url;
this.id = id;
this.parent = parent;
this.userContext = context;
// keep-sorted end
this.defaultRealm = this.#createWindowRealm();
}
@ -283,7 +280,6 @@ export class BrowsingContext extends EventEmitter<{
});
}
// keep-sorted start block=yes
get #session() {
return this.userContext.browser.session;
}
@ -314,7 +310,6 @@ export class BrowsingContext extends EventEmitter<{
get url(): string {
return this.#url;
}
// keep-sorted end
#createWindowRealm(sandbox?: string) {
const realm = WindowRealm.from(this, sandbox);

View File

@ -38,19 +38,16 @@ export class Navigation extends EventEmitter<{
return navigation;
}
// keep-sorted start
#request: Request | undefined;
#navigation: Navigation | undefined;
readonly #browsingContext: BrowsingContext;
readonly #disposables = new DisposableStack();
#id?: string | null;
// keep-sorted end
private constructor(context: BrowsingContext) {
super();
// keep-sorted start
this.#browsingContext = context;
// keep-sorted end
}
#initialize() {
@ -151,7 +148,6 @@ export class Navigation extends EventEmitter<{
return this.#id === navigation;
}
// keep-sorted start block=yes
get #session() {
return this.#browsingContext.userContext.browser.session;
}
@ -164,7 +160,6 @@ export class Navigation extends EventEmitter<{
get navigation(): Navigation | undefined {
return this.#navigation;
}
// keep-sorted end
@inertIfDisposed
private dispose(): void {

View File

@ -44,23 +44,19 @@ export abstract class Realm extends EventEmitter<{
/** Emitted when a shared worker is created in the realm. */
sharedworker: SharedWorkerRealm;
}> {
// keep-sorted start
#reason?: string;
protected readonly disposables = new DisposableStack();
readonly id: string;
readonly origin: string;
protected executionContextId?: number;
// keep-sorted end
protected constructor(id: string, origin: string) {
super();
// keep-sorted start
this.id = id;
this.origin = origin;
// keep-sorted end
}
// keep-sorted start block=yes
get disposed(): boolean {
return this.#reason !== undefined;
}
@ -68,7 +64,6 @@ export abstract class Realm extends EventEmitter<{
get target(): Bidi.Script.Target {
return {realm: this.id};
}
// keep-sorted end
@inertIfDisposed
protected dispose(reason?: string): void {
@ -159,19 +154,16 @@ export class WindowRealm extends Realm {
return realm;
}
// keep-sorted start
readonly browsingContext: BrowsingContext;
readonly sandbox?: string;
// keep-sorted end
readonly #workers = new Map<string, DedicatedWorkerRealm>();
private constructor(context: BrowsingContext, sandbox?: string) {
super('', '');
// keep-sorted start
this.browsingContext = context;
this.sandbox = sandbox;
// keep-sorted end
}
#initialize(): void {
@ -248,10 +240,8 @@ export class DedicatedWorkerRealm extends Realm {
return realm;
}
// keep-sorted start
readonly #workers = new Map<string, DedicatedWorkerRealm>();
readonly owners: Set<DedicatedWorkerOwnerRealm>;
// keep-sorted end
private constructor(
owner: DedicatedWorkerOwnerRealm,
@ -306,10 +296,8 @@ export class SharedWorkerRealm extends Realm {
return realm;
}
// keep-sorted start
readonly #workers = new Map<string, DedicatedWorkerRealm>();
readonly browser: Browser;
// keep-sorted end
private constructor(browser: Browser, id: string, origin: string) {
super(id, origin);

View File

@ -32,24 +32,21 @@ export class Request extends EventEmitter<{
return request;
}
// keep-sorted start
#error?: string;
#redirect?: Request;
#response?: Bidi.Network.ResponseData;
readonly #browsingContext: BrowsingContext;
readonly #disposables = new DisposableStack();
readonly #event: Bidi.Network.BeforeRequestSentParameters;
// keep-sorted end
private constructor(
browsingContext: BrowsingContext,
event: Bidi.Network.BeforeRequestSentParameters
) {
super();
// keep-sorted start
this.#browsingContext = browsingContext;
this.#event = event;
// keep-sorted end
}
#initialize() {
@ -107,7 +104,6 @@ export class Request extends EventEmitter<{
});
}
// keep-sorted start block=yes
get #session() {
return this.#browsingContext.userContext.browser.session;
}
@ -154,7 +150,6 @@ export class Request extends EventEmitter<{
get isBlocked(): boolean {
return this.#event.isBlocked;
}
// keep-sorted end
async continueRequest({
url,

View File

@ -81,21 +81,18 @@ export class Session
return session;
}
// keep-sorted start
#reason: string | undefined;
readonly #disposables = new DisposableStack();
readonly #info: Bidi.Session.NewResult;
readonly browser!: Browser;
@bubble()
accessor connection: Connection;
// keep-sorted end
private constructor(connection: Connection, info: Bidi.Session.NewResult) {
super();
// keep-sorted start
this.#info = info;
this.connection = connection;
// keep-sorted end
}
async #initialize(): Promise<void> {
@ -121,7 +118,6 @@ export class Session
});
}
// keep-sorted start block=yes
get capabilities(): Bidi.Session.NewResult['capabilities'] {
return this.#info.capabilities;
}
@ -134,7 +130,6 @@ export class Session
get id(): string {
return this.#info.sessionId;
}
// keep-sorted end
@inertIfDisposed
private dispose(reason?: string): void {

View File

@ -52,21 +52,18 @@ export class UserContext extends EventEmitter<{
return context;
}
// keep-sorted start
#reason?: string;
// Note these are only top-level contexts.
readonly #browsingContexts = new Map<string, BrowsingContext>();
readonly #disposables = new DisposableStack();
readonly #id: string;
readonly browser: Browser;
// keep-sorted end
private constructor(browser: Browser, id: string) {
super();
// keep-sorted start
this.#id = id;
this.browser = browser;
// keep-sorted end
}
#initialize() {
@ -110,7 +107,6 @@ export class UserContext extends EventEmitter<{
});
}
// keep-sorted start block=yes
get #session() {
return this.browser.session;
}
@ -126,7 +122,6 @@ export class UserContext extends EventEmitter<{
get id(): string {
return this.#id;
}
// keep-sorted end
@inertIfDisposed
private dispose(reason?: string): void {

View File

@ -49,23 +49,20 @@ export class UserPrompt extends EventEmitter<{
return userPrompt;
}
// keep-sorted start
#reason?: string;
#result?: UserPromptResult;
readonly #disposables = new DisposableStack();
readonly browsingContext: BrowsingContext;
readonly info: Bidi.BrowsingContext.UserPromptOpenedParameters;
// keep-sorted end
private constructor(
context: BrowsingContext,
info: Bidi.BrowsingContext.UserPromptOpenedParameters
) {
super();
// keep-sorted start
this.browsingContext = context;
this.info = info;
// keep-sorted end
}
#initialize() {
@ -89,7 +86,6 @@ export class UserPrompt extends EventEmitter<{
});
}
// keep-sorted start block=yes
get #session() {
return this.browsingContext.userContext.browser.session;
}
@ -105,7 +101,6 @@ export class UserPrompt extends EventEmitter<{
get result(): UserPromptResult | undefined {
return this.#result;
}
// keep-sorted end
@inertIfDisposed
private dispose(reason?: string): void {