wasm-bindgen
wasm-bindgen copied to clipboard
Mark some set_* fns as potentially throwing.
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].
Ready for review
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?
It is a breaking change, but currently the generated code is incorrect (some attribute setters can throw and agent caught by web_sys). Do you allow breaking changes to correct errors?
On Tue, 5 Apr 2022, 15:55 Alex Crichton, @.***> wrote:
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?
— Reply to this email directly, view it on GitHub https://github.com/rustwasm/wasm-bindgen/pull/2852#issuecomment-1088817891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKT4XQVOPVPO2JB4X4R2XLVDRH55ANCNFSM5SPYL6DQ . You are receiving this because you authored the thread.Message ID: @.***>
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.
Ok no worries shall I leave the pr open?
On Wed, 6 Apr 2022, 16:42 Alex Crichton, @.***> wrote:
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.
— Reply to this email directly, view it on GitHub https://github.com/rustwasm/wasm-bindgen/pull/2852#issuecomment-1090419969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKT4XSYVRIO2XBC4W4X3FDVDWWGZANCNFSM5SPYL6DQ . You are receiving this because you authored the thread.Message ID: @.***>