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

Incompatibility with ColdFusion in arraySwap() behaviour with sparse arrays

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.0.013
    • Fix Version/s: 4.1.0.000, 4.0.1.001
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      <cfscript>
      a = ["tahi", "toru", "rua", "wha"];
      a = [];
      a[1] = "tahi";
      a[3] = "rua";
      a[4] = "wha";

      writeDump(a);

      arraySwap(a, 2, 3);
      writeDump(a);
      </cfscript>

      Show
      <cfscript> a = ["tahi", "toru", "rua", "wha"] ; a = []; a [1] = "tahi"; a [3] = "rua"; a [4] = "wha"; writeDump(a); arraySwap(a, 2, 3); writeDump(a); </cfscript>

      Description

      Railo breaks on the arraySwap() call with:

      Railo 4.0.0.013 Error (expression)
      Message can't swap values of array
      Detail Element at position [2] doesn't exist in array

      CF manages this all right, so I'd've thought Railo would / ought to as well. If one can have empty array elements, array functions should be able to cope with them, yes?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                adamcameroncf Adam Cameron
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: