Skip to content

Mark some set_* fns as potentially throwing. #2852

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

richard-uk1
Copy link
Contributor

Make attributes marked [SetterThrows] use a set_* function that returns a Result. Currently webidl only looks for a [Throws] attribute.

I found this problem while writing an indexed DB wrapper. The function web_sys::IdbObjectStore::set_name should return a Result, because setting the name can go wrong in a number of ways. When I looked at the IDL files, the attribute had a [SetterThrows] mark rather than the more general [Throws].

Make attributes marked `[SetterThrows]` use a `set_*` function that
returns a `Result`. Currently webidl only looks for a `[Throws]`
attribute.
@richard-uk1
Copy link
Contributor Author

Ready for review

@richard-uk1 richard-uk1 mentioned this pull request Apr 5, 2022
@alexcrichton
Copy link
Contributor

This naively looks like a breaking change which is something I don't want to commit to. Is there a reason though that this won't be an issue in practice?

@richard-uk1
Copy link
Contributor Author

richard-uk1 commented Apr 5, 2022 via email

@alexcrichton
Copy link
Contributor

Sorry I'm not merging breaking changes at this time because I'm not personally prepared to deal with the fallout. I wish I had a better answer for you but I do not at this time.

@richard-uk1
Copy link
Contributor Author

richard-uk1 commented Apr 6, 2022 via email

@Liamolucko Liamolucko added the breaking-change Tracking breaking changes for the next major version bump (if ever) label Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Tracking breaking changes for the next major version bump (if ever)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants