Title: [123376] trunk/Source/_javascript_Core
- Revision
- 123376
- Author
- [email protected]
- Date
- 2012-07-23 13:53:35 -0700 (Mon, 23 Jul 2012)
Log Message
Move JSC::parseDate() from DateConversion to JSDateMath
https://bugs.webkit.org/show_bug.cgi?id=91982
Reviewed by Geoffrey Garen.
Moveing this function into the other files removes the dependency
on JSC spcific classes in DateConversion.{cpp|h}.
* runtime/DateConversion.cpp:
* runtime/DateConversion.h:
(JSC):
* runtime/JSDateMath.cpp:
(JSC::parseDate):
(JSC):
* runtime/JSDateMath.h:
(JSC):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (123375 => 123376)
--- trunk/Source/_javascript_Core/ChangeLog 2012-07-23 20:46:11 UTC (rev 123375)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-07-23 20:53:35 UTC (rev 123376)
@@ -1,3 +1,22 @@
+2012-07-23 Patrick Gansterer <[email protected]>
+
+ Move JSC::parseDate() from DateConversion to JSDateMath
+ https://bugs.webkit.org/show_bug.cgi?id=91982
+
+ Reviewed by Geoffrey Garen.
+
+ Moveing this function into the other files removes the dependency
+ on JSC spcific classes in DateConversion.{cpp|h}.
+
+ * runtime/DateConversion.cpp:
+ * runtime/DateConversion.h:
+ (JSC):
+ * runtime/JSDateMath.cpp:
+ (JSC::parseDate):
+ (JSC):
+ * runtime/JSDateMath.h:
+ (JSC):
+
2012-07-23 Simon Fraser <[email protected]>
Part 1 of: Implement sticky positioning
Modified: trunk/Source/_javascript_Core/runtime/DateConversion.cpp (123375 => 123376)
--- trunk/Source/_javascript_Core/runtime/DateConversion.cpp 2012-07-23 20:46:11 UTC (rev 123375)
+++ trunk/Source/_javascript_Core/runtime/DateConversion.cpp 2012-07-23 20:53:35 UTC (rev 123376)
@@ -55,18 +55,6 @@
namespace JSC {
-double parseDate(ExecState* exec, const UString &date)
-{
- if (date == exec->globalData().cachedDateString)
- return exec->globalData().cachedDateStringValue;
- double value = parseES5DateFromNullTerminatedCharacters(date.utf8().data());
- if (isnan(value))
- value = parseDateFromNullTerminatedCharacters(exec, date.utf8().data());
- exec->globalData().cachedDateString = date;
- exec->globalData().cachedDateStringValue = value;
- return value;
-}
-
void formatDate(const GregorianDateTime &t, DateConversionBuffer& buffer)
{
snprintf(buffer, DateConversionBufferSize, "%s %s %02d %04d",
Modified: trunk/Source/_javascript_Core/runtime/DateConversion.h (123375 => 123376)
--- trunk/Source/_javascript_Core/runtime/DateConversion.h 2012-07-23 20:46:11 UTC (rev 123375)
+++ trunk/Source/_javascript_Core/runtime/DateConversion.h 2012-07-23 20:53:35 UTC (rev 123376)
@@ -42,8 +42,6 @@
#ifndef DateConversion_h
#define DateConversion_h
-#include "UString.h"
-
namespace JSC {
class ExecState;
@@ -52,7 +50,6 @@
static const unsigned DateConversionBufferSize = 100;
typedef char DateConversionBuffer[DateConversionBufferSize];
-double parseDate(ExecState* exec, const UString&);
void formatDate(const GregorianDateTime&, DateConversionBuffer&);
void formatDateUTCVariant(const GregorianDateTime&, DateConversionBuffer&);
void formatTime(const GregorianDateTime&, DateConversionBuffer&);
Modified: trunk/Source/_javascript_Core/runtime/JSDateMath.cpp (123375 => 123376)
--- trunk/Source/_javascript_Core/runtime/JSDateMath.cpp 2012-07-23 20:46:11 UTC (rev 123375)
+++ trunk/Source/_javascript_Core/runtime/JSDateMath.cpp 2012-07-23 20:53:35 UTC (rev 123376)
@@ -259,4 +259,16 @@
return ms - (offset * WTF::msPerMinute);
}
+double parseDate(ExecState* exec, const UString& date)
+{
+ if (date == exec->globalData().cachedDateString)
+ return exec->globalData().cachedDateStringValue;
+ double value = parseES5DateFromNullTerminatedCharacters(date.utf8().data());
+ if (isnan(value))
+ value = parseDateFromNullTerminatedCharacters(exec, date.utf8().data());
+ exec->globalData().cachedDateString = date;
+ exec->globalData().cachedDateStringValue = value;
+ return value;
+}
+
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/JSDateMath.h (123375 => 123376)
--- trunk/Source/_javascript_Core/runtime/JSDateMath.h 2012-07-23 20:46:11 UTC (rev 123375)
+++ trunk/Source/_javascript_Core/runtime/JSDateMath.h 2012-07-23 20:53:35 UTC (rev 123376)
@@ -48,12 +48,14 @@
namespace JSC {
class ExecState;
+class UString;
struct GregorianDateTime;
void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&);
double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC);
double getUTCOffset(ExecState*);
double parseDateFromNullTerminatedCharacters(ExecState*, const char* dateString);
+double parseDate(ExecState*, const UString&);
// Intentionally overridding the default tm of the system.
// The members of tm differ on various operating systems.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes