(&self)
| 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()?; |