You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2019/05/22 16:32:00 UTC

[jira] [Resolved] (JEXL-303) Block syntax is broken

     [ https://issues.apache.org/jira/browse/JEXL-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-303.
--------------------------------
    Resolution: Fixed

Thanks for the bug report; https://github.com/apache/commons-jexl/commit/68d1b317f38e49a6cad3c283ad05c7d79f29b490

> Block syntax is broken
> ----------------------
>
>                 Key: JEXL-303
>                 URL: https://issues.apache.org/jira/browse/JEXL-303
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> The following script fails to parse correctly
> {code}
> {if (0) 1 else 2; var x = 1;}
> {code}
> while the following script parses perfectly
> {code}
> {var x = 1; if (0) 1 else 2;}
> {code}
> Tested with 
> {code}
>     @Test
>     public void testOuterBlock() throws Exception {
>         JexlScript e = JEXL.createScript("{if (0) 1 else 2; var x = 1;}");
>         JexlContext jc = new MapContext();
>         Object o = e.execute(jc);
>         Assert.assertEquals("Block result is wrong", 1, o);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)