MCPcopy Index your code
hub / github.com/RustPython/RustPython / detach

Method detach

crates/wasm/src/js_module.rs:368–375  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

366 }
367 #[pymethod]
368 fn detach(&self, vm: &VirtualMachine) -> PyResult<PyJsValueRef> {
369 let (closure, js_val) = self.closure.replace(None).ok_or_else(|| {
370 vm.new_value_error("can't detach closure has already been detached or destroyed")
371 })?;
372 closure.forget();
373 self.detached.set(true);
374 Ok(js_val)
375 }
376 }
377
378 #[pyattr]

Callers 1

timeoutFunction · 0.45

Calls 4

ok_or_elseMethod · 0.80
replaceMethod · 0.45
forgetMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected