Skip to content

Commit

Permalink
Fix $eval call to evaluate. #58
Browse files Browse the repository at this point in the history
Call internal evaluate that does not reset the context
  • Loading branch information
uw4 committed Dec 11, 2024
1 parent a50f5f9 commit 17436de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/dashjoin/jsonata/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ public static Object functionEval(String expr, Object focus) {
}
Object result = null;
try {
result = ast.evaluate(input, env);
result = Jsonata.current.get().evaluate(ast.ast, input, env);
} catch(Throwable err) {
// error evaluating the expression passed to $eval
//populateMessage(err);
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/dashjoin/jsonata/CustomFunctionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public void testEval() {
Assertions.assertEquals("Hello world", expression.evaluate(null));
}

@Disabled
@Test
public void testEvalWithParams() {
var expression = Jsonata.jsonata("($eval('$greet()'))");
Expand Down

0 comments on commit 17436de

Please sign in to comment.