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

Add [Symbol.dispose] support for ref types #5691

Open
yf-yang opened this issue Aug 7, 2024 · 2 comments
Open

Add [Symbol.dispose] support for ref types #5691

yf-yang opened this issue Aug 7, 2024 · 2 comments
Labels

Comments

@yf-yang
Copy link
Contributor

yf-yang commented Aug 7, 2024

Calling .unref() is just fine, but sometimes it could be forgotten and cause memory leaks.

TC39 stage 3 proposal https://github.com/tc39/proposal-explicit-resource-management is aimed at solving the problem. We can add a Symbol.dispose method to those pathRef, pointRef, rangeRef to keep up with the spec.

The only possible problem here is that we don't know how Symbol.dispose is supported in different js runtimes. I believe latest browsers and node has already supported it, but not sure about previous versions. Can't find the info in CanIUse, either.

@yf-yang yf-yang added the feature label Aug 7, 2024
@work-in-progress-danny
Copy link
Contributor

Seems related to #5726

@yf-yang
Copy link
Contributor Author

yf-yang commented Oct 30, 2024

Nope, just a standard compatible API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants