Project

Profile

Help

Bug #3370

closed

currentGroup / currentGroupingKey

Added by Michael Kay over 6 years ago. Updated over 6 years ago.

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

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
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.

Actions #1

Updated by Michael Kay over 6 years 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;
Actions #2

Updated by Debbie Lockett over 6 years 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.

Actions #3

Updated by Debbie Lockett over 6 years ago

  • Applies to JS Branch 1.0, Trunk added
Actions #4

Updated by Debbie Lockett over 6 years 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.

Actions #5

Updated by Debbie Lockett over 6 years 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