Skip to main content

Module panic_scope

Module panic_scope 

Expand description

Which window’s application code is running, for a panic hook to name.

The browser build aborts on a panic, so an application that panics cannot be caught and unwound; the page has to start again. A host that knows which window was running can start it again without that window (see the browser runtime’s crash quarantine) instead of losing every window to the same panic on each load.

A Scope marks the window (its tab id) for as long as it lives; scopes nest, and the innermost names the window. Nothing unwinds past an abort, so the window running when a panic hook fires is still the current one.

Structs§

Scope
Restores the enclosing window when dropped: see enter.

Functions§

current
The window whose application code is running on this thread, if any.
enter
Marks tab as running until dropped. None keeps the enclosing window.