Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-459

localscope doesn't allow get to leak

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None

      Description

      In short, we wanted "localscope" on for macros due to some recursion. However, this meant that both puts /and/ gets only use the localscope.

      For gets this seems overly restrictive--if I set "foo=bar" in my base VelocityContext, and then get into my macro, it should be able to reach that "foo" even if it can't overwrite it.

      The attached patch relaxes the "VMContext.get" to let it check first the local scope and then the inner scope. Included is a test that makes sure an "outsideVar" is accessible from VMContext even if localscope is on.

        Attachments

          Activity

            People

            • Assignee:
              wglass Will Glass-Husain
              Reporter:
              stephenh Stephen Haberman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: