html icon indicating copy to clipboard operation
html copied to clipboard

Can a task throw exceptions?

Open Ms2ger opened this issue 1 year ago • 2 comments

What is the issue with the HTML Standard?

The event loop does not seem to handle exceptions, so I guess reading as a pedant any exception would shut it down entirely? This doesn't sound right. Probably the definition of task steps should explicitly disallow them from throwing exceptions (and then one could review all of them) or the event loop should quash them.

Ms2ger avatar Jan 29 '24 10:01 Ms2ger

Per https://infra.spec.whatwg.org/#algorithm-control-flow that seems correct.

I would expect steps that execute JavaScript to handle exceptions in the same way https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke (step 10) does.

Do you have any steps in mind that are problematic?

annevk avatar Jan 29 '24 17:01 annevk

I noticed it in #10104, but I would be surprised if that was the only offender

Ms2ger avatar Jan 30 '24 13:01 Ms2ger