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

[v9] fix: dispose properly binds its object #2871

Merged
merged 3 commits into from
Jun 10, 2023
Merged

Conversation

krispya
Copy link
Member

@krispya krispya commented Jun 5, 2023

No description provided.

@krispya krispya changed the title fix: dispose properly binds its object [v9] fix: dispose properly binds its object Jun 5, 2023
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 5, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9e0b2d1:

Sandbox Source
example Configuration

dispose()
dispose.call(child.object)
Copy link
Member

Choose a reason for hiding this comment

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

child.object can be mutated the time this runs. I'd prefer to const dispose = child.object.dispose.bind(child.object).

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I think to use bind we need to check that we are binding to a function that actually exists first, otherwise it is fine.

@krispya krispya merged commit cab6d59 into pmndrs:v9 Jun 10, 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.

2 participants