Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
None
Description
Consider the following test case (suppose its added to IfTest)
@Test public void testTernaryFail() throws Exception { JexlEvalContext jc = new JexlEvalContext(); JexlExpression e = JEXL.createExpression("false ? bar : quux"); Object o; jc.setStrict(true); jc.setSilent(false); try { o = e.evaluate(jc); Assert.fail("Should have failed"); } catch (Exception ex) { // OK } }
The expected behavior is to fail with undefined variable... because neither bar nor quux is defined