Add js_eval/2 for wasm32

This commit is contained in:
Adrián Arroyo Calle
2023-11-20 17:45:22 +01:00
parent f32b035287
commit 36ab590c4e
8 changed files with 114 additions and 18 deletions

View File

@@ -51,7 +51,8 @@ use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn eval_code(s: &str) -> String {
use machine::mock_wam::*;
use web_sys::console;
console_error_panic_hook::set_once();
let mut wam = Machine::with_test_streams();
let bytes = wam.test_load_string(s);