Skip to content

Commit 17436de

Browse files
committed
Fix $eval call to evaluate. #58
Call internal evaluate that does not reset the context
1 parent a50f5f9 commit 17436de

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/main/java/com/dashjoin/jsonata/Functions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ public static Object functionEval(String expr, Object focus) {
23892389
}
23902390
Object result = null;
23912391
try {
2392-
result = ast.evaluate(input, env);
2392+
result = Jsonata.current.get().evaluate(ast.ast, input, env);
23932393
} catch(Throwable err) {
23942394
// error evaluating the expression passed to $eval
23952395
//populateMessage(err);

src/test/java/com/dashjoin/jsonata/CustomFunctionTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public void testEval() {
2424
Assertions.assertEquals("Hello world", expression.evaluate(null));
2525
}
2626

27-
@Disabled
2827
@Test
2928
public void testEvalWithParams() {
3029
var expression = Jsonata.jsonata("($eval('$greet()'))");

0 commit comments

Comments
 (0)