//! Panic reporting for the browser binding.
//!
//! `wasm32-unknown-unknown` has no stderr, so Rust's default hook formats each
//! panic and then discards it. Without a replacement the host observes only
//! `RuntimeError: unreachable`, which is identical for an arithmetic overflow,
//! an out-of-bounds index, and the `already borrowed` failure that every later
//! call produces once a panic has poisoned an exported object. The binary
//! already carries the messages and source locations; this routes them out.
use Once;
use *;
/// Installs the panic reporter as the module is instantiated.
///
/// `wasm-bindgen` calls this from the generated initializer, so every entry
/// point is covered without the host opting in.
/// Forwards panic messages and source locations to `console.error`.
///
/// The panic still aborts; this only makes the cause observable. Reporting
/// through an `Error` gives the console a stack alongside the message.