getRuntimeFromJS gets Go Runtime from C JSRuntime (internal use).
(cRt *C.JSRuntime)
| 55 | |
| 56 | // getRuntimeFromJS gets Go Runtime from C JSRuntime (internal use). |
| 57 | func getRuntimeFromJS(cRt *C.JSRuntime) *Runtime { |
| 58 | if value, ok := runtimeMapping.Load(cRt); ok { |
| 59 | rt, ok := value.(*Runtime) |
| 60 | if !ok { |
| 61 | runtimeMapping.Delete(cRt) |
| 62 | return nil |
| 63 | } |
| 64 | if !rt.isAlive() { |
| 65 | runtimeMapping.Delete(cRt) |
| 66 | return nil |
| 67 | } |
| 68 | return rt |
| 69 | } |
| 70 | return nil |
| 71 | } |