[webkit-changes] cvs commit: JavaScriptCore/kjs date_object.cpp
Geoffrey
ggaren at opensource.apple.com
Tue Sep 20 01:07:58 PDT 2005
ggaren 05/09/20 01:07:57
Modified: . ChangeLog
kjs date_object.cpp
Log:
- Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
Need to restore int/long changes to simple_number.h
Test cases added:
* layout-tests/fast/js/date-big-constructor-expected.txt: Added.
* layout-tests/fast/js/date-big-constructor.html: Added.
Reviewed by darin.
* kjs/date_object.cpp:
(KJS::fillStructuresUsingDateArgs):
(KJS::makeTime):
Revision Changes Path
1.829 +16 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.828
retrieving revision 1.829
diff -u -r1.828 -r1.829
--- ChangeLog 19 Sep 2005 21:53:21 -0000 1.828
+++ ChangeLog 20 Sep 2005 08:07:56 -0000 1.829
@@ -1,3 +1,19 @@
+2005-09-20 Geoffrey Garen <ggaren at apple.com>
+
+ - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
+ Need to restore int/long changes to simple_number.h
+
+ Test cases added:
+
+ * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
+ * layout-tests/fast/js/date-big-constructor.html: Added.
+
+ Reviewed by darin.
+
+ * kjs/date_object.cpp:
+ (KJS::fillStructuresUsingDateArgs):
+ (KJS::makeTime):
+
2005-09-19 Geoffrey Garen <ggaren at apple.com>
- Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
1.56 +10 -9 JavaScriptCore/kjs/date_object.cpp
Index: date_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/date_object.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- date_object.cpp 7 Sep 2005 23:27:28 -0000 1.55
+++ date_object.cpp 20 Sep 2005 08:07:57 -0000 1.56
@@ -465,12 +465,7 @@
// months
if (maxArgs >= 2 && idx < numArgs) {
- int months = args[idx++]->toInt32(exec);
-
- // t->tm_year must hold the bulk of the data to avoid overflow when converting
- // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.)
- t->tm_year += months / 12;
- t->tm_mon = months % 12;
+ t->tm_mon = args[idx++]->toInt32(exec);
}
// days
@@ -1014,7 +1009,7 @@
{
int utcOffset;
if (utc) {
- time_t zero = 0;
+ time_t zero = 0;
#if defined BSD || defined(__linux__) || defined(__APPLE__)
struct tm t3;
localtime_r(&zero, &t3);
@@ -1030,9 +1025,15 @@
t->tm_isdst = 0;
#endif
} else {
- utcOffset = 0;
- t->tm_isdst = -1;
+ utcOffset = 0;
+ t->tm_isdst = -1;
}
+
+ // t->tm_year must hold the bulk of the data to avoid overflow when converting
+ // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.)
+ t->tm_year += t->tm_mon / 12;
+ t->tm_mon %= 12;
+
double yearOffset = 0.0;
if (t->tm_year < (1970 - 1900) || t->tm_year > (2038 - 1900)) {
More information about the webkit-changes
mailing list