Project

Profile

Help

Bug #3370

currentGroup / currentGroupingKey

Added by Michael Kay 12 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Low
Assignee:
Sprint/Milestone:
-
Start date:
2017-08-06
Due date:
% Done:

100%

Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

In the for-each-group code (compare.js line 966) appears:

unsortedGroupIter.forEachItem(function (groupInfo, pos) {
                groupInfo.sortKeys =
                    sortKeys.map(function (s) {
                        var f = unsortedGroupContext.focus;
                        f.current = groupInfo.group[0];
                        f.position = pos + 1;
                        f.currentGroup = groupInfo.group;
                        f.currentGroupingKey = groupInfo.key;
                        return Expr.evalChild1(s, unsortedGroupContext).next();
                    });
            });

This is putting currentGroup and currentGroupingKey into the Tracker object (which is an iterator). However, in Expr.js line 472 and 480, we always get the values of currentGroup and currentGroupingKey from the Context object itself, not from the Tracker.

History

#1 Updated by Michael Kay 12 months ago

On the 2.0 branch, this is causing failures of tests such as for-each-group-007 where the groups are sorted by the value of current-grouping-key() - the test fails saying there is no current grouping key. Fixed on the 2.0 branch by changing the relevant lines of the above to:

                        unsortedGroupContext.currentGroup = groupInfo.group;
                        unsortedGroupContext.currentGroupingKey = groupInfo.key;

#2 Updated by Debbie Lockett 11 months ago

Fix also committed on Saxon-JS 1.0 branch (in Compare.js). for-each-group-005 now passes, even if for-each-group-007 still doesn't.

#3 Updated by Debbie Lockett 11 months ago

  • Applies to JS Branch 1.0, Trunk added

#4 Updated by Debbie Lockett 11 months ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

Test for-each-group-007 is now also passing. I'm not quite sure why I was seeing a failure but not anymore. I suspect one of the other recent bug fixes has done it.

Marking as resolved.

#5 Updated by Debbie Lockett 10 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.0.2

Bug fix applied in Saxon-JS 1.0.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page