Fixing readonly ops not to modify context when paths dont exist

This commit is contained in:
Mike Farah
2021-05-16 14:17:13 +10:00
parent 3f51a44596
commit 0b71a40797
10 changed files with 88 additions and 26 deletions
+1 -3
View File
@@ -7,9 +7,7 @@ import (
)
func deleteChildOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
contextToUse := context.Clone()
contextToUse.DontAutoCreate = true
nodesToDelete, err := d.GetMatchingNodes(contextToUse, expressionNode.Rhs)
nodesToDelete, err := d.GetMatchingNodes(context.ReadOnlyClone(), expressionNode.Rhs)
if err != nil {
return Context{}, err