Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-303

Block syntax is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None

    Description

      The following script fails to parse correctly

      {if (0) 1 else 2; var x = 1;}
      

      while the following script parses perfectly

      {var x = 1; if (0) 1 else 2;}
      

      Tested with

          @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);
          }
      

      Attachments

        Activity

          People

            henrib Henri Biestro
            dmitri_blinov Dmitri Blinov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: