Velocity
  1. Velocity
  2. VELOCITY-50

RFE: invalid parameters for #if directive should be a parse error?

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      The 3 lines below will print two No-s and one Yes:
      #if('foo') Yes #else No #end
      #if(1) Yes #else
      No #end
      #if(true) Yes #else No #end

      while the 4 lines bellow will print two Yes-es as
      expected:
      #set($x = 'foo')
      #if($x) Yes #else No #end
      #set($x = 1)
      #if($x) Yes #else No
      #end

      Also, the 2 lines below will print false:
      #set($x = 'x' && true)
      $x

      (Please
      ignore possible false line breaks inserted by bugzilla.)

      Tried with 1.2 Stable and 1.3
      Nightly 22/03

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Dekany
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development