Add console_error_panic_hook

This commit is contained in:
Daniel Kluge 2024-01-03 12:49:05 +01:00
parent 798582ae7d
commit 49edf93691

View File

@ -1,3 +1,4 @@
extern crate console_error_panic_hook;
mod types; mod types;
mod commands; mod commands;
use std::{cell::RefCell, rc::Rc}; use std::{cell::RefCell, rc::Rc};
@ -184,6 +185,8 @@ impl Console {
#[wasm_bindgen] #[wasm_bindgen]
impl Console { impl Console {
pub fn new() -> Console { pub fn new() -> Console {
console_error_panic_hook::set_once();
let root = Rc::new(RefCell::new(Directory::new("".to_string(), "".to_string()))); let root = Rc::new(RefCell::new(Directory::new("".to_string(), "".to_string())));
let console = Console { let console = Console {