MCPcopy Create free account
hub / github.com/buke/quickjs-go / getContextAndObject

Function getContextAndObject

callback_dispatch.go:27–40  ·  view source on GitHub ↗

getContextAndObject retrieves context and callback target from HandleStore.

(ctx *C.JSContext, magic C.int, notFoundErr proxyError)

Source from the content-addressed store, hash-verified

25
26// getContextAndObject retrieves context and callback target from HandleStore.
27func 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, &notFoundErr
37 }
38
39 return goCtx, fn, nil
40}
41
42//export goInterruptHandler
43func goInterruptHandler(runtimePtr *C.JSRuntime) C.int {

Callers 6

goClassConstructorProxyFunction · 0.85
goFunctionProxyFunction · 0.85
goClassMethodProxyFunction · 0.85
goClassGetterProxyFunction · 0.85
goClassSetterProxyFunction · 0.85

Calls 2

getContextFromJSFunction · 0.85

Tested by

no test coverage detected