fix: add missing await in adoptIfNeeded (#32497)

Otherwise it throws in Bidi.
This commit is contained in:
Yury Semikhatsky 2024-09-06 13:17:32 -07:00 committed by GitHub
parent d85527e9f6
commit 11441c0fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -160,7 +160,7 @@ export class FrameSelectors {
async function adoptIfNeeded<T extends Node>(handle: ElementHandle<T>, context: FrameExecutionContext): Promise<ElementHandle<T>> { async function adoptIfNeeded<T extends Node>(handle: ElementHandle<T>, context: FrameExecutionContext): Promise<ElementHandle<T>> {
if (handle._context === context) if (handle._context === context)
return handle; return handle;
const adopted = handle._page._delegate.adoptElementHandle(handle, context); const adopted = await handle._page._delegate.adoptElementHandle(handle, context);
handle.dispose(); handle.dispose();
return adopted; return adopted;
} }