Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows XP Professional
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Just changed the name of the function argument so there is no ambiguity, but thought you might want to be aware of this.

      Show
      Just changed the name of the function argument so there is no ambiguity, but thought you might want to be aware of this.

      Description

      We had an existing cfscript function that accepted a "url" parameter. However, references to this parameter within the function actually referenced the URL scope rather than the parameter passed in.

      <cfscript>
      function test(url)
      {
      ...references to url here actually reference the URL scope rather than the url parameter...
      }
      </cfscript>

        Gliffy Diagrams

          Activity

          Hide
          micstriit Michael Offner added a comment -

          in Railo are 2 knowed incompatibilities to cfmx, this is one of them.
          In Railo scope name always reference to scopes, also inside functions.
          in cfmx scope name always reference only outside a function to scopes.

          if you do something like this outside a function in cfmx and railo
          <cfset url="test">
          <cfdump var="#url#">

          the dump still output the scope, because scope names come first.
          you have to write variables.url to reference "test".

          why this is not the same with local and argument scope in a function?
          you still can adress your argument by writing "arguments.url" same as example above with variables scope.

          but the reason because railo work not the same way cfmx does, is that in your example the url scope is no longer available and there should be no way to supress scopes.

          Show
          micstriit Michael Offner added a comment - in Railo are 2 knowed incompatibilities to cfmx, this is one of them. In Railo scope name always reference to scopes, also inside functions. in cfmx scope name always reference only outside a function to scopes. if you do something like this outside a function in cfmx and railo <cfset url="test"> <cfdump var="#url#"> the dump still output the scope, because scope names come first. you have to write variables.url to reference "test". why this is not the same with local and argument scope in a function? you still can adress your argument by writing "arguments.url" same as example above with variables scope. but the reason because railo work not the same way cfmx does, is that in your example the url scope is no longer available and there should be no way to supress scopes.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development