From 8b57b3549218f055b83b376922ef69a21ad74738 Mon Sep 17 00:00:00 2001 From: bakaq Date: Sat, 12 Oct 2024 19:22:56 -0300 Subject: [PATCH] Fix wasm --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 495ea1148..85ee726ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,6 +47,7 @@ pub use machine::config::*; pub use machine::lib_machine::*; pub use machine::Machine; +/// Eval a source file in Wasm. #[cfg(target_arch = "wasm32")] #[wasm_bindgen] pub fn eval_code(s: &str) -> String { @@ -54,7 +55,7 @@ pub fn eval_code(s: &str) -> String { console_error_panic_hook::set_once(); - let mut wam = Machine::with_test_streams(); + let mut wam = MachineBuilder::default().build(); let bytes = wam.test_load_string(s); String::from_utf8_lossy(&bytes).to_string() }