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

Method evalInt

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

Source from the content-addressed store, hash-verified

208}
209
210func (s *quickjsGoSession) evalInt(script string) (int64, error) {
211 value := s.ctx.Eval(script)
212 if value == nil {
213 return 0, fmt.Errorf("quickjs-go eval returned nil")
214 }
215 defer value.Free()
216 if value.IsException() || s.ctx.HasException() {
217 return 0, s.ctx.Exception()
218 }
219 return value.Int64(), nil
220}
221
222func (s *quickjsGoSession) evalString(script string) (string, error) {
223 value := s.ctx.Eval(script)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected