reverse() modifies its argument
After calling reverse($var), the value of $var is changed to be in reverse order.
reverse is implemented as
arg is an iterator. The problem is that (a) if
arg is a ForArray iterator, then
reverse() modifies its argument in-situ.
So the code needs to ensure that the array is copied before calling
reverse()@, or perhaps to avoid the @expand() operation and prepend each item returned by the iterator to a target array.
(Reported informally by John Lumley)
Updated by Debbie Lockett over 6 years ago
- Status changed from In Progress to Resolved
- Fix Committed on JS Branch 1.0 added
XSLT 3.0 test sequence-2002 added.
(Note that fix was added to code before split into 1.0 and trunk branches, which is why this is only marked as applying to 1.0 branch.)
Please register to edit this issue