Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ class FrameSession {
return null;
if (frame === this._page.mainFrame())
return { x: 0, y: 0 };
const element = await frame.frameElement(nullProgress);
using element = await frame.frameElement(nullProgress);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we should as part of this go through and change the other manual finally { foo.dispose(); } (e.g. _retryWithProgressIfNotConnected, waitForFunctionExpression, etc.)?

or would you rather have that be a followup (or just when that code is next modified)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included this one instance as a test that it works and that the tests pass.

const box = await element.boundingBox(nullProgress);
return box;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/playwright-core/src/server/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export class JSHandle<T = any> extends SdkObject {
}
}

[Symbol.dispose]() {
this.dispose();
}

override toString(): string {
return this._preview;
}
Expand Down
1 change: 1 addition & 0 deletions utils/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ class EsbuildStep extends Step {
sourcemap: withSourceMaps ? 'linked' : false,
platform: 'node',
format: 'cjs',
target: 'node20',
...options,
};
this._watchPaths = watchPaths;
Expand Down
Loading