check _objectId in releaseHandle
This commit is contained in:
parent
e8b601ad3d
commit
fdda58d738
|
|
@ -122,9 +122,11 @@ export class BidiExecutionContext implements js.ExecutionContextDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
||||||
|
if (!handle._objectId)
|
||||||
|
return;
|
||||||
await this._session.send('script.disown', {
|
await this._session.send('script.disown', {
|
||||||
target: this._target,
|
target: this._target,
|
||||||
handles: [handle._objectId!],
|
handles: [handle._objectId],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,9 @@ export class CRExecutionContext implements js.ExecutionContextDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
||||||
await releaseObject(this._client, handle._objectId!);
|
if (!handle._objectId)
|
||||||
|
return;
|
||||||
|
await releaseObject(this._client, handle._objectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,11 @@ export class FFExecutionContext implements js.ExecutionContextDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
||||||
|
if (!handle._objectId)
|
||||||
|
return;
|
||||||
await this._session.send('Runtime.disposeObject', {
|
await this._session.send('Runtime.disposeObject', {
|
||||||
executionContextId: this._executionContextId,
|
executionContextId: this._executionContextId,
|
||||||
objectId: handle._objectId!,
|
objectId: handle._objectId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,9 @@ export class WKExecutionContext implements js.ExecutionContextDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
async releaseHandle(handle: js.JSHandle): Promise<void> {
|
||||||
await this._session.send('Runtime.releaseObject', { objectId: handle._objectId! });
|
if (!handle._objectId)
|
||||||
|
return;
|
||||||
|
await this._session.send('Runtime.releaseObject', { objectId: handle._objectId });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue