(script string)
| 208 | } |
| 209 | |
| 210 | func (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 | |
| 222 | func (s *quickjsGoSession) evalString(script string) (string, error) { |
| 223 | value := s.ctx.Eval(script) |
nothing calls this directly
no test coverage detected