Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-2195

add support for the Elvis Operator

    Details

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

      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.

        Gliffy Diagrams

          Activity

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

          testcase attached

          Show
          micstriit Michael Offner added a comment - testcase attached

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development