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

Method evalString

benchcmp/engines.go:222–232  ·  view source on GitHub ↗
(script string)

Source from the content-addressed store, hash-verified

220}
221
222func (s *quickjsGoSession) evalString(script string) (string, error) {
223 value := s.ctx.Eval(script)
224 if value == nil {
225 return "", fmt.Errorf("quickjs-go eval returned nil")
226 }
227 defer value.Free()
228 if value.IsException() || s.ctx.HasException() {
229 return "", s.ctx.Exception()
230 }
231 return value.String(), nil
232}
233
234func (s *quickjsGoSession) close() {
235 if s.ctx != nil {

Callers

nothing calls this directly

Calls 6

EvalMethod · 0.80
IsExceptionMethod · 0.80
HasExceptionMethod · 0.80
ExceptionMethod · 0.80
FreeMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected