mirror of
https://github.com/wader/fq.git
synced 2024-08-16 23:40:43 +03:00
interp: Fix infinite recursion when casting synthetic raw value into a jq value
This commit is contained in:
parent
4783e52d78
commit
29e75411ed
@ -89,6 +89,8 @@ func ToGoJQValueFn(v any, valueFn func(v any) (any, error)) (any, error) {
|
||||
vvs[k] = v
|
||||
}
|
||||
return vvs, nil
|
||||
case error:
|
||||
return nil, vv
|
||||
default:
|
||||
nv, err := valueFn(vv)
|
||||
if err != nil {
|
||||
|
@ -634,12 +634,15 @@ func (v decodeValue) JQValueToGoJQEx(optsFn func() (*Options, error)) any {
|
||||
return v.JQValueToGoJQ()
|
||||
}
|
||||
|
||||
bv, err := v.decodeValueBase.ToBinary()
|
||||
if err != nil {
|
||||
return err
|
||||
if s, ok := v.dv.V.(scalar.Scalarable); ok && !s.ScalarFlags().IsSynthetic() {
|
||||
bv, err := v.ToBinary()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return bv.JQValueToGoJQEx(optsFn)
|
||||
}
|
||||
|
||||
return bv.JQValueToGoJQEx(optsFn)
|
||||
return v.JQValueToGoJQ()
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user