Re: [heycam/webidl] Annotations for what may throw (#603)

There's another problem here.  There are various situations (e.g. out of memory or any other resource constraint) that allow any method call to throw at any point and are not really standardized other than being allowed to exist.  Whether they can actually throw is implementation-specific.  For example, in Gecko, allocating a DOM node can't throw, but allocating a Promise can.  And the JIT use cases for [Throws] in Gecko need to actually know when things might throw _including_ these non-spec situations, because we optimize out the "did it throw?" check when the method can't throw.

So standardizing [Throws] would be a bit complicated: it would need to either be set on things where _any_ browser might end up throwing (which is subject to change at any time) or browser IDL would need to not match the spec in various cases.

As for the bindgen use case, what semantics do they want in these non-specced-throw situations?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/603#issuecomment-449067535

Received on Thursday, 20 December 2018 17:04:46 UTC