Closed
Bug 1300110
Opened 9 years ago
Closed 1 year ago
DateTime doesn't clear cache for different time zones with same tz-adjustment
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
INCOMPLETE
Tracking | Status | |
---|---|---|
firefox51 | --- | affected |
People
(Reporter: anba, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
6.99 KB,
text/x-c++src
|
Details |
This optimization [1] isn't correct. Two time zones may use the same offset, but still have different time zone rules, e.g. America/Denver and America/Phoenix. The attached test case is currently failing for America/Los_Angeles and America/Phoenix, but that's caused by bug 830304.
[1] http://hg.mozilla.org/mozilla-central/file/d5f20820c805/js/src/vm/DateTime.cpp#l158
Reporter | ||
Comment 1•9 years ago
|
||
There is a similar issue in DateObject::fillLocalTimeSlots(), updated the test case accordingly.
[1] http://hg.mozilla.org/mozilla-central/file/d5f20820c805/js/src/jsdate.cpp#l1253
Attachment #8787634 -
Attachment is obsolete: true
Updated•7 years ago
|
Priority: -- → P3
Updated•3 years ago
|
Severity: normal → S3
Comment 3•1 year ago
|
||
All the referenced code seems gone now.
Reporter | ||
Comment 4•1 year ago
|
||
Reporter | ||
Comment 6•1 year ago
|
||
Hmm, I think we should at least add a comment to that line of code to explain the current situation. Things have slightly changed since this bug has been filed:
- The public JSAPI function
JS::ResetTimeZone
will always trigger a time zone update, even if the offset is unchanged. (That means the test code attached to this bug doesn't show this issue anymore.) - Only when the internal
js::ResetTimeZoneInternal
function is called fromJS::Realm::init
for our periodic time zone modification checks, the bug described here can be observed. - Bug 1343826 added support to receive time zone change messages from the OS, so it shouldn't actually be necessary anymore for
JS::Realm::init
to check for time zone changes. At least as long as bug 1343826 covers all supported OSes and it works correctly -- and it doesn't quite seem to work on Ubuntu when manually modifying the time zone through the system settings. STR:- Open dev-tools and evaluate
new Intl.DateTimeFormat().resolvedOptions().timeZone
. - Change system time zone, for example from
Europe/Berlin
toEurope/Paris
. - Switch back to the dev-tools console and evaluate
new Intl.DateTimeFormat().resolvedOptions().timeZone
again. - For me it's both times returning
Europe/Berlin
. Chromium correctly returnsEurope/Paris
after changing the time zone.
- Open dev-tools and evaluate
Flags: needinfo?(andrebargull)
You need to log in
before you can comment on or make changes to this bug.
Description
•