Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Won't Fix Won't Fix
    • Affects Version/s: 3.0 Beta (3.0.0.002)
    • 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.
    • Similar Issues:
      Show 10 results 

      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>

        Activity

        Hide
        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
        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:
            Michael Offner
            Reporter:
            Helen Somers
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: