chore: remove redundant type-check (#11678)

This commit is contained in:
Darío Kondratiuk 2024-01-15 05:39:52 -03:00 committed by GitHub
parent 0ac68b4776
commit 3b3b9c385f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -371,11 +371,7 @@ export class ChromeTargetManager
this.#attachedTargetsBySessionId.set(session.id(), target);
}
if (parentSession instanceof CDPSession) {
parentSession.emit(CDPSessionEvent.Ready, session);
} else {
parentSession.emit(CDPSessionEvent.Ready, session);
}
parentSession.emit(CDPSessionEvent.Ready, session);
this.#targetsIdsForInit.delete(target._targetId);
if (!isExistingTarget) {

View File

@ -146,14 +146,14 @@ export class CdpTarget extends Target {
override browser(): Browser {
if (!this.#browserContext) {
throw new Error('browserContext is not initialised');
throw new Error('browserContext is not initialized');
}
return this.#browserContext.browser();
}
override browserContext(): BrowserContext {
if (!this.#browserContext) {
throw new Error('browserContext is not initialised');
throw new Error('browserContext is not initialized');
}
return this.#browserContext;
}