(&self, vm: &VirtualMachine)
| 357 | |
| 358 | #[pymethod] |
| 359 | fn destroy(&self, vm: &VirtualMachine) -> PyResult<()> { |
| 360 | let (closure, _) = self.closure.replace(None).ok_or_else(|| { |
| 361 | vm.new_value_error("can't destroy closure has already been destroyed or detached") |
| 362 | })?; |
| 363 | drop(closure); |
| 364 | self.destroyed.set(true); |
| 365 | Ok(()) |
| 366 | } |
| 367 | #[pymethod] |
| 368 | fn detach(&self, vm: &VirtualMachine) -> PyResult<PyJsValueRef> { |
| 369 | let (closure, js_val) = self.closure.replace(None).ok_or_else(|| { |
nothing calls this directly
no test coverage detected