hasValidRef reports whether the context still has a valid native handle.
()
| 32 | |
| 33 | // hasValidRef reports whether the context still has a valid native handle. |
| 34 | func (ctx *Context) hasValidRef() bool { |
| 35 | if ctx == nil || ctx.ref == nil || ctx.runtime == nil { |
| 36 | return false |
| 37 | } |
| 38 | return ctx.runtime.ensureOwnerAccess() |
| 39 | } |
| 40 | |
| 41 | // isAlive reports whether the context can safely reach QuickJS. |
| 42 | func (ctx *Context) isAlive() bool { |
no test coverage detected