Title: [113451] trunk/Source/_javascript_Core
Revision
113451
Author
[email protected]
Date
2012-04-06 10:10:11 -0700 (Fri, 06 Apr 2012)

Log Message

Remove JSC dependency from GregorianDateTime
https://bugs.webkit.org/show_bug.cgi?id=83290

Reviewed by Geoffrey Garen.

This allows us to move it to WTF later.

* runtime/DateConstructor.cpp:
(JSC::callDate):
* runtime/JSDateMath.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (113450 => 113451)


--- trunk/Source/_javascript_Core/ChangeLog	2012-04-06 17:10:07 UTC (rev 113450)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-04-06 17:10:11 UTC (rev 113451)
@@ -1,3 +1,16 @@
+2012-04-06  Patrick Gansterer  <[email protected]>
+
+        Remove JSC dependency from GregorianDateTime
+        https://bugs.webkit.org/show_bug.cgi?id=83290
+
+        Reviewed by Geoffrey Garen.
+
+        This allows us to move it to WTF later.
+
+        * runtime/DateConstructor.cpp:
+        (JSC::callDate):
+        * runtime/JSDateMath.h:
+
 2012-04-05  Michael Saboff  <[email protected]>
 
         Call Heap::discardAllCompiledCode() in low memory situations

Modified: trunk/Source/_javascript_Core/runtime/DateConstructor.cpp (113450 => 113451)


--- trunk/Source/_javascript_Core/runtime/DateConstructor.cpp	2012-04-06 17:10:07 UTC (rev 113450)
+++ trunk/Source/_javascript_Core/runtime/DateConstructor.cpp	2012-04-06 17:10:11 UTC (rev 113451)
@@ -166,9 +166,8 @@
 // ECMA 15.9.2
 static EncodedJSValue JSC_HOST_CALL callDate(ExecState* exec)
 {
-    tm localTM;
-    getCurrentLocalTime(&localTM);
-    GregorianDateTime ts(exec, localTM);
+    GregorianDateTime ts;
+    msToGregorianDateTime(exec, currentTimeMS(), false, ts);
     DateConversionBuffer date;
     DateConversionBuffer time;
     formatDate(ts, date);

Modified: trunk/Source/_javascript_Core/runtime/JSDateMath.h (113450 => 113451)


--- trunk/Source/_javascript_Core/runtime/JSDateMath.h	2012-04-06 17:10:07 UTC (rev 113450)
+++ trunk/Source/_javascript_Core/runtime/JSDateMath.h	2012-04-06 17:10:11 UTC (rev 113451)
@@ -74,33 +74,6 @@
     {
     }
 
-    GregorianDateTime(ExecState* exec, const tm& inTm)
-        : second(inTm.tm_sec)
-        , minute(inTm.tm_min)
-        , hour(inTm.tm_hour)
-        , weekDay(inTm.tm_wday)
-        , monthDay(inTm.tm_mday)
-        , yearDay(inTm.tm_yday)
-        , month(inTm.tm_mon)
-        , year(inTm.tm_year)
-        , isDST(inTm.tm_isdst)
-    {
-        UNUSED_PARAM(exec);
-#if HAVE(TM_GMTOFF)
-        utcOffset = static_cast<int>(inTm.tm_gmtoff);
-#else
-        utcOffset = static_cast<int>(getUTCOffset(exec) / WTF::msPerSecond + (isDST ? WTF::secondsPerHour : 0));
-#endif
-
-#if HAVE(TM_ZONE)
-        int inZoneSize = strlen(inTm.tm_zone) + 1;
-        timeZone = adoptArrayPtr(new char[inZoneSize]);
-        strncpy(timeZone.get(), inTm.tm_zone, inZoneSize);
-#else
-        timeZone = nullptr;
-#endif
-    }
-
     operator tm() const
     {
         tm ret;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to