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

Function zeroTerminatedBytes

context.go:76–80  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

74}
75
76func zeroTerminatedBytes(s string) []byte {
77 b := make([]byte, len(s)+1)
78 copy(b, s)
79 return b
80}
81
82func (ctx *Context) detectModuleSource(code string, codePtr *C.char) bool {
83 if !mayContainModuleSyntax(code) || !ctx.hasValidRef() {

Callers 4

initializeContextGlobalsFunction · 0.85
ParseJSONMethod · 0.85
EvalMethod · 0.85
LoadModuleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected