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

"Invoke the Function. Use the third and subseque..." #2287

Closed
tbodt opened this issue Jan 24, 2017 · 3 comments
Closed

"Invoke the Function. Use the third and subseque..." #2287

tbodt opened this issue Jan 24, 2017 · 3 comments
Labels
clarification Standard could be clearer

Comments

@tbodt
Copy link

tbodt commented Jan 24, 2017

https://html.spec.whatwg.org/#timers:es-invoking-callback-functions

Invoke the Function. Use the third and subsequent method arguments (if any) as the arguments for invoking the Function. Use method context proxy as the callback this value.

I believe this is missing exception handling. What happens if a timer callback is a function and that function throws an exception?

@annevk annevk added the clarification Standard could be clearer label Jan 24, 2017
@annevk
Copy link
Member

annevk commented Jan 24, 2017

Hmm yeah, that should probably invoke "report the exception" with the exception. It's really surprising this hasn't been noticed until now though. Makes me wonder whether I'm missing something.

@domenic
Copy link
Member

domenic commented Jan 24, 2017

I think the plan was to clean this up as part of #958, but a quick patch would not be a bad idea in the meantime.

@domenic
Copy link
Member

domenic commented Mar 14, 2024

This has since become more correct:

If handler is a Function, then invoke handler given arguments with the callback this value set to thisArg. If this throws an exception, catch it, and report the exception.

@domenic domenic closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

No branches or pull requests

3 participants