fix: remove circular import in IsolatedWorld (#11228)

This commit is contained in:
Alex Rudenko 2023-10-23 12:54:45 +02:00 committed by GitHub
parent 20eb38d61b
commit 3edce3aee9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ import {Mutex} from '../util/Mutex.js';
import type {Binding} from './Binding.js'; import type {Binding} from './Binding.js';
import {type ExecutionContext, createCdpHandle} from './ExecutionContext.js'; import {type ExecutionContext, createCdpHandle} from './ExecutionContext.js';
import {CdpFrame} from './Frame.js'; import type {CdpFrame} from './Frame.js';
import type {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; import type {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js';
import type {WebWorker} from './WebWorker.js'; import type {WebWorker} from './WebWorker.js';
@ -94,7 +94,7 @@ export class IsolatedWorld extends Realm {
clearContext(): void { clearContext(): void {
this.#context = Deferred.create(); this.#context = Deferred.create();
if (this.#frameOrWorker instanceof CdpFrame) { if ('clearDocumentHandle' in this.#frameOrWorker) {
this.#frameOrWorker.clearDocumentHandle(); this.#frameOrWorker.clearDocumentHandle();
} }
} }