(script string)
| 220 | } |
| 221 | |
| 222 | func (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 | |
| 234 | func (s *quickjsGoSession) close() { |
| 235 | if s.ctx != nil { |
nothing calls this directly
no test coverage detected