Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-114 Allow scripts to create local variables // Add return keyword
  3. JEXL-113

Add functions to extract which variables, parameters and local variables are used to evaluate a script

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.1
    • None
    • JDK 1.6

    Description

      When a variable of the form a.b is evaluated, the context is asked first for the value of a. That value is then asked for the value of b.

      So far, so good: this is exactly what you'd expect from the dot operator.

      But if the value of b is null, the context is then asked for the value of a.b, in other words the dot operator is ignored and "a.b" is considered to be a single variable.

      This is at best confusing. Granted, this can be avoided with the a['b'] notation, but that's clumsy.

      I assume this is an attempt to support both the dot operator and ant-style variables. I don't think you can have both and remain sane.

      Suggestion: either document this behavior, or make it an option. My vote would be to just use the value returned, even if it's null. Either dot is an operator, or it's not. Perhaps make that configurable?

      Thanks!

      Attachments

        Activity

          People

            henrib Henri Biestro
            maxtardiveau Max Tardiveau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: