(vm *goja.Runtime, err error, value goja.Value)
| 119 | } |
| 120 | |
| 121 | func jsErrorString(vm *goja.Runtime, err error, value goja.Value) string { |
| 122 | if err != nil { |
| 123 | if exception, ok := err.(*goja.Exception); ok { |
| 124 | return exception.String() |
| 125 | } |
| 126 | return err.Error() |
| 127 | } |
| 128 | if value == nil || goja.IsUndefined(value) || goja.IsNull(value) { |
| 129 | return "<empty>" |
| 130 | } |
| 131 | object := value.ToObject(vm) |
| 132 | if stack := object.Get("stack"); !goja.IsUndefined(stack) && !goja.IsNull(stack) { |
| 133 | return stack.String() |
| 134 | } |
| 135 | if message := object.Get("message"); !goja.IsUndefined(message) && !goja.IsNull(message) { |
| 136 | return message.String() |
| 137 | } |
| 138 | return value.String() |
| 139 | } |
| 140 | |
| 141 | const vqdResultMutationScript = ` |
| 142 | (function (result) { |
no test coverage detected