You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed by accident that JSONata mutates the variable passed to the evaluate method call, if evaluation fails due to an error associated with that variable, here's the reproduction branch: #589
it("should not mutate bound variable on failure",function(){varexpr=jsonata("$myVariable()");varmyVariable={"foo": "bar"};try{expr.evaluate(testdata2,{ myVariable });}catch(e){// ignore the evaluation error}expect(myVariable).to.deep.equal({"foo": "bar"});});
The text was updated successfully, but these errors were encountered:
asennikov
changed the title
JSONata mutates bindings passed as arguments during evaluate call
[bug] JSONata mutates bindings passed as arguments during evaluate call
Aug 24, 2022
I've noticed by accident that JSONata mutates the variable passed to the
evaluate
method call, if evaluation fails due to an error associated with that variable, here's the reproduction branch: #589The text was updated successfully, but these errors were encountered: