operator-map/filter.go: added deletion of temporary variables '_index' and '_count'
This commit is contained in:
parent
6e98bdd16b
commit
ce7bfc5e3f
@ -52,6 +52,8 @@ func evalFilter(ctx ExprContext, opTerm *term) (v any, err error) {
|
||||
err = fmt.Errorf("filter expression must return a boolean or a castable to boolean, got %v [%T]", rightValue, rightValue)
|
||||
}
|
||||
}
|
||||
ctx.DeleteVar("_count")
|
||||
ctx.DeleteVar("_index")
|
||||
ctx.DeleteVar("_")
|
||||
if err != nil {
|
||||
break
|
||||
|
||||
@ -46,6 +46,8 @@ func evalMap(ctx ExprContext, opTerm *term) (v any, err error) {
|
||||
if rightValue, err = opTerm.children[1].compute(ctx); err == nil {
|
||||
values.appendItem(rightValue)
|
||||
}
|
||||
ctx.DeleteVar("_count")
|
||||
ctx.DeleteVar("_index")
|
||||
ctx.DeleteVar("_")
|
||||
if err != nil {
|
||||
break
|
||||
|
||||
Loading…
Reference in New Issue
Block a user