Revision: 5293
Author: a...@chromium.org
Date: Wed Aug 18 00:35:42 2010
Log: Push fix for DST offsets to the 2.1 branch. This is only a problem in
Egypt because of suspended DST during Ramadan in 2010.
Review URL: http://codereview.chromium.org/3169021
http://code.google.com/p/v8/source/detail?r=5293
Modified:
/branches/2.1/src/date.js
/branches/2.1/src/version.cc
=======================================
--- /branches/2.1/src/date.js Tue Jul 13 05:53:53 2010
+++ /branches/2.1/src/date.js Wed Aug 18 00:35:42 2010
@@ -137,12 +137,18 @@
// Time interval where the cached offset is valid.
start: 0, end: -1,
// Size of next interval expansion.
- increment: 0
+ increment: 0,
+ initial_increment: 19 * msPerDay
};
// NOTE: The implementation relies on the fact that no time zones have
-// more than one daylight savings offset change per month.
+// more than one daylight savings offset change per 19 days.
+//
+// In Egypt in 2010 they decided to suspend DST during Ramadan. This
+// led to a short interval where DST is in effect from September 10 to
+// September 30.
+//
// If this function is called with NaN it returns NaN.
function DaylightSavingsOffset(t) {
// Load the cache object from the builtins object.
@@ -171,7 +177,7 @@
// the offset in the cache, we grow the cached time interval
// and return the offset.
cache.end = new_end;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
return end_offset;
} else {
var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
@@ -182,7 +188,7 @@
// the interval to reflect this and reset the increment.
cache.start = t;
cache.end = new_end;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
} else {
// The interval contains a DST offset change and the given time
is
// before it. Adjust the increment to avoid a linear search for
@@ -207,7 +213,7 @@
var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
cache.offset = offset;
cache.start = cache.end = t;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
return offset;
}
=======================================
--- /branches/2.1/src/version.cc Tue Jul 13 05:53:53 2010
+++ /branches/2.1/src/version.cc Wed Aug 18 00:35:42 2010
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 2
#define MINOR_VERSION 1
#define BUILD_NUMBER 10
-#define PATCH_LEVEL 15
+#define PATCH_LEVEL 16
#define CANDIDATE_VERSION false
// Define SONAME to have the SCons build the put a specific SONAME into the
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev