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

Railo not finding un-scoped variables in arguments when undeclared in method signature

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.3.002
    • Fix Version/s: 4.1.0.002, 4.0.3.003
    • Labels:
      None

      Description

      The following code sample works on ACF, but errors on Railo 4.0.3.

      function callme()

      { writeOutput(foo); // errors "variable [FOO] doesn't exist" }

      callMe(foo='test');

      Basically, if I dump out the arguments scope, I can see foo in there but I have to do one of two things to be able to access it: always write out arguments.foo, OR declare the foo parameter in the function. Railo's scope hunting behavior doesn't seen to pick up arguments that weren't declared in the function.

      Under Railo Scope settings, I have "Cascading" set to "Standard (CFML Default)" and "local scope mode" to "update (CFML standard)" so I would expect the same behavior as ACF in this regard.

      Here is ACF's documentation on the behavior:

      UDFs accept "optional, undeclared arguments."
      http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a66e-7fe2.html

      "If you use a variable name without a scope prefix, ColdFusion checks the scopes in the following order to find the variable:"
      http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec09af4-7fdf.html

      Regardless of the incompatibility with ACF, I think the behavior is unexpected and inconsistent since the variable is visible in the arguments scope when you dump it out and Railo is supposed to search the arguments scope with the settings I am using.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                bdw429s Brad Wood
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: