Fixing readonly ops not to modify context when paths dont exist

This commit is contained in:
Mike Farah
2021-05-16 14:00:30 +10:00
parent afebf0e621
commit 3f51a44596
12 changed files with 95 additions and 18 deletions
+1 -3
View File
@@ -11,9 +11,7 @@ func selectOperator(d *dataTreeNavigator, context Context, expressionNode *Expre
for el := context.MatchingNodes.Front(); el != nil; el = el.Next() {
candidate := el.Value.(*CandidateNode)
childContext := context.SingleChildContext(candidate)
childContext.DontAutoCreate = true
rhs, err := d.GetMatchingNodes(childContext, expressionNode.Rhs)
rhs, err := d.GetMatchingNodes(context.SingleReadonlyChildContext(candidate), expressionNode.Rhs)
if err != nil {
return Context{}, err