Shouldn't roots be disposed when their scope function throws?
Describe the bug
When something throws (Directly) inside of a function passed to createRoot(), the root that was being created doesn't get disposed.
Is this expected?
Your Example Website or App
https://playground.solidjs.com/anonymous/1e6d765f-717a-4fef-a981-573593533dcc
Steps to Reproduce the Bug or Issue
- Go to the playground link
- Check the console
Expected behavior
The root should be disposed and "Disposing" should be logged
Screenshots or Videos
No response
Platform
(Irrelevant)
Additional context
No response
During dev mode, the component could be automatically disposed due to solid-refresh, in that case you need to put
/* @refresh skip */
at the start of your file to reproduce the issue
It's an interesting question.. Usually it is the parent or some manual mechanism responsible for disposal. That being said if you don't even get access to the dispose then what can anyone expect to do with it. Honestly it never occurred to me to dispose in this case. Top level render dispose call also destroys the DOM nodes. Is that expected? Hmm.. I might need to think about this.
I think it's probably expected that whatever render() did will get reverted by the disposal, even the DOM nodes