(id: String, inject_browser_module: Option<bool>)
| 109 | #[wasm_bindgen(js_class = vmStore)] |
| 110 | impl VMStore { |
| 111 | pub fn init(id: String, inject_browser_module: Option<bool>) -> WASMVirtualMachine { |
| 112 | STORED_VMS.with_borrow_mut(|vms| { |
| 113 | if !vms.contains_key(&id) { |
| 114 | let stored_vm = |
| 115 | StoredVirtualMachine::new(id.clone(), inject_browser_module.unwrap_or(true)); |
| 116 | vms.insert(id.clone(), Rc::new(stored_vm)); |
| 117 | } |
| 118 | }); |
| 119 | WASMVirtualMachine { id } |
| 120 | } |
| 121 | |
| 122 | pub(crate) fn _get(id: String) -> Option<WASMVirtualMachine> { |
| 123 | STORED_VMS.with_borrow(|vms| vms.contains_key(&id).then_some(WASMVirtualMachine { id })) |
nothing calls this directly
no test coverage detected