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

Function convertCArgsToGoValues

callback_dispatch.go:13–24  ·  view source on GitHub ↗

convertCArgsToGoValues converts C arguments to Go Value slice (unified helper). Reused by all proxy functions for consistent parameter conversion.

(argc C.int, argv *C.JSValueConst, ctx *Context)

Source from the content-addressed store, hash-verified

11// convertCArgsToGoValues converts C arguments to Go Value slice (unified helper).
12// Reused by all proxy functions for consistent parameter conversion.
13func convertCArgsToGoValues(argc C.int, argv *C.JSValueConst, ctx *Context) []*Value {
14 if argc == 0 {
15 return nil
16 }
17
18 cArgs := unsafe.Slice(argv, int(argc))
19 goArgs := make([]*Value, int(argc))
20 for i, cArg := range cArgs {
21 goArgs[i] = &Value{ctx: ctx, ref: C.JSValue(cArg)}
22 }
23 return goArgs
24}
25
26// getContextAndObject retrieves context and callback target from HandleStore.
27func getContextAndObject(ctx *C.JSContext, magic C.int, notFoundErr proxyError) (*Context, interface{}, *proxyError) {

Callers 3

goClassConstructorProxyFunction · 0.85
goFunctionProxyFunction · 0.85
goClassMethodProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected