getContextAndObject retrieves context and callback target from HandleStore.
(ctx *C.JSContext, magic C.int, notFoundErr proxyError)
| 25 | |
| 26 | // getContextAndObject retrieves context and callback target from HandleStore. |
| 27 | func getContextAndObject(ctx *C.JSContext, magic C.int, notFoundErr proxyError) (*Context, interface{}, *proxyError) { |
| 28 | goCtx := getContextFromJS(ctx) |
| 29 | if goCtx == nil { |
| 30 | return nil, nil, &errContextNotFound |
| 31 | } |
| 32 | |
| 33 | funcID := int32(magic) |
| 34 | fn := goCtx.loadFunctionFromHandleID(funcID) |
| 35 | if fn == nil { |
| 36 | return goCtx, nil, ¬FoundErr |
| 37 | } |
| 38 | |
| 39 | return goCtx, fn, nil |
| 40 | } |
| 41 | |
| 42 | //export goInterruptHandler |
| 43 | func goInterruptHandler(runtimePtr *C.JSRuntime) C.int { |
no test coverage detected