Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix circularity on JSHandle interface #9661

Merged
merged 1 commit into from
Feb 13, 2023
Merged

fix: fix circularity on JSHandle interface #9661

merged 1 commit into from
Feb 13, 2023

Conversation

jrandolf
Copy link
Contributor

This PR fixes the ongoing problem related to circularity on the JSHandle.

For background, the original implementation attempted to make use of the fact the this object was a JSHandle of type T. Since the EvaluateFunc type flatten handles, it's assumed the compiler could deal with this which it does. However, this causes another problem to arise where the return type is considered self-referencing because the return type is derived from EvaluateFunc<[this,... which looks somewhat like EvaluateFunc<[EvaluateFunc<[EvaluateFunc<[...,...,...,... to the compiler.

Our solution here is to flatten the this value to the actual type we want. This way no inference is needed, so the compile doesn't see the circular type above.

@jrandolf jrandolf merged commit eb13863 into main Feb 13, 2023
@jrandolf jrandolf deleted the typescript branch February 13, 2023 19:25
This was referenced Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants