Railo
  1. Railo
  2. RAILO-2195

add support for the Elvis Operator

    Details

    • Type: Feature Request Feature Request
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.1.0.000
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      add support for the Elvis Operator

      Example Code:
      Z= x ?: 'Elvis';

      Pattern:
      <variable-declaration>?:<default-value>

      What exactly happen with this operator?
      if the declared variable exist and is not null, the value is returned, otherwise the right operant.

        Activity

        Show
        Michael Offner
        added a comment - https://github.com/getrailo/railo/commit/c86fe8311e60bacbd50d86bc3fe4495ccc015ef8
        Hide
        Michael Offner
        added a comment -

        testcase attached

        Show
        Michael Offner
        added a comment - testcase attached

          People

          • Assignee:
            Michael Offner
            Reporter:
            Michael Offner
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: