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

Method assert_valid

crates/wasm/src/vm_class.rs:196–205  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

194 }
195
196 pub fn assert_valid(&self) -> Result<(), JsValue> {
197 if self.valid() {
198 Ok(())
199 } else {
200 Err(TypeError::new(
201 "Invalid VirtualMachine, this VM was destroyed while this reference was still held",
202 )
203 .into())
204 }
205 }
206
207 pub fn destroy(&self) -> Result<(), JsValue> {
208 self.assert_valid()?;

Callers 4

newMethod · 0.80
withMethod · 0.80
destroyMethod · 0.80
py_to_jsFunction · 0.80

Calls 3

newFunction · 0.85
ErrClass · 0.50
validMethod · 0.45

Tested by

no test coverage detected