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

try-using should throw immediately if object does not have dispose/asyncDispose #34

Closed
rbuckton opened this issue Aug 1, 2019 · 0 comments · Fixed by #36
Closed

try-using should throw immediately if object does not have dispose/asyncDispose #34

rbuckton opened this issue Aug 1, 2019 · 0 comments · Fixed by #36

Comments

@rbuckton
Copy link
Collaborator

rbuckton commented Aug 1, 2019

Suggested by Sebastian Markbåge during the July TC39 meeting. The concern is that checking for the presence of @@dispose or @@asyncDispose at the end of the try-using block is problematic as the exception is thrown after side effects have happened in the block.

The proposed resolution is to capture the @@dispose or @@asyncDispose method at the start of the block and throwing an exception if the method is not present or not callable at that time.

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 a pull request may close this issue.

1 participant