mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: remove import cycle (#11227)
This commit is contained in:
parent
60f1b788a6
commit
525f13cd18
@ -26,7 +26,6 @@ import {
|
||||
PuppeteerURL,
|
||||
SOURCE_URL_REGEX,
|
||||
createEvaluationError,
|
||||
debugError,
|
||||
getSourcePuppeteerURLIfAvailable,
|
||||
getSourceUrlComment,
|
||||
isString,
|
||||
@ -400,22 +399,3 @@ export function createCdpHandle(
|
||||
}
|
||||
return new CdpJSHandle(realm, remoteObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function releaseObject(
|
||||
client: CDPSession,
|
||||
remoteObject: Protocol.Runtime.RemoteObject
|
||||
): Promise<void> {
|
||||
if (!remoteObject.objectId) {
|
||||
return;
|
||||
}
|
||||
await client
|
||||
.send('Runtime.releaseObject', {objectId: remoteObject.objectId})
|
||||
.catch(error => {
|
||||
// Exceptions might happen in case of a page been navigated or closed.
|
||||
// Swallow these since they are harmless and we don't leak anything in this case.
|
||||
debugError(error);
|
||||
});
|
||||
}
|
||||
|
@ -18,10 +18,9 @@ import type {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {CDPSession} from '../api/CDPSession.js';
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {valueFromRemoteObject} from '../common/util.js';
|
||||
import {debugError, valueFromRemoteObject} from '../common/util.js';
|
||||
|
||||
import type {CdpElementHandle} from './ElementHandle.js';
|
||||
import {releaseObject} from './ExecutionContext.js';
|
||||
import type {IsolatedWorld} from './IsolatedWorld.js';
|
||||
|
||||
/**
|
||||
@ -98,3 +97,22 @@ export class CdpJSHandle<T = unknown> extends JSHandle<T> {
|
||||
return this.#remoteObject;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function releaseObject(
|
||||
client: CDPSession,
|
||||
remoteObject: Protocol.Runtime.RemoteObject
|
||||
): Promise<void> {
|
||||
if (!remoteObject.objectId) {
|
||||
return;
|
||||
}
|
||||
await client
|
||||
.send('Runtime.releaseObject', {objectId: remoteObject.objectId})
|
||||
.catch(error => {
|
||||
// Exceptions might happen in case of a page been navigated or closed.
|
||||
// Swallow these since they are harmless and we don't leak anything in this case.
|
||||
debugError(error);
|
||||
});
|
||||
}
|
||||
|
@ -73,12 +73,13 @@ import {Coverage} from './Coverage.js';
|
||||
import type {DeviceRequestPrompt} from './DeviceRequestPrompt.js';
|
||||
import {CdpDialog} from './Dialog.js';
|
||||
import {EmulationManager} from './EmulationManager.js';
|
||||
import {createCdpHandle, releaseObject} from './ExecutionContext.js';
|
||||
import {createCdpHandle} from './ExecutionContext.js';
|
||||
import {FirefoxTargetManager} from './FirefoxTargetManager.js';
|
||||
import type {CdpFrame} from './Frame.js';
|
||||
import {FrameManager, FrameManagerEvent} from './FrameManager.js';
|
||||
import {CdpKeyboard, CdpMouse, CdpTouchscreen} from './Input.js';
|
||||
import {MAIN_WORLD} from './IsolatedWorlds.js';
|
||||
import {releaseObject} from './JSHandle.js';
|
||||
import type {Credentials, NetworkConditions} from './NetworkManager.js';
|
||||
import type {CdpTarget} from './Target.js';
|
||||
import type {TargetManager} from './TargetManager.js';
|
||||
|
Loading…
Reference in New Issue
Block a user