Project

Profile

Help

Bug #4787

Map failures with temporal keys using timezones under advanced closure compilation.

Added by John Lumley 15 days ago. Updated 14 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-10-07
Due date:
% Done:

0%

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

Description

When maps are merged with keys involving timezone-adjusted values, under advanced closure compiler optimisation, duplicate key errors can be raised, which are not under simple optimisation (i.e. SaxonJS2.debug.js). map-size-014 is an example. The issue is in HashTrie/stdOptions/sameKey#41:

 return ("timezoneOffset" in n) && n.timezoneOffset !== null;

where under CC advanced optimisation the property timezoneOffset has been renamed, and thus the "timezoneOffset" in n check fails. The intention seems to be to only check if there is a timezoneOffset defined, and it is not null. Simply changing to

timezoneOffset.n && n.timezoneOffset !== null;

corrects these faults but introduces three others, in same-key-02[67] and MapConstructor-042.

This might be rather tricky without 'reserving' the timezoneOffset property - trying to determine the existence of renamed properties.

History

#1 Updated by John Lumley 15 days ago

Should be

n.timezoneOffset && n.timezoneOffset !== null;

#2 Updated by Michael Kay 14 days ago

The potential gotcha here is when timezoneOffset is present but equal to zero.

Please register to edit this issue

Also available in: Atom PDF Tracking page