Changeset 123376 in webkit
- Timestamp:
- Jul 23, 2012 1:53:35 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r123350 r123376 1 2012-07-23 Patrick Gansterer <paroga@webkit.org> 2 3 Move JSC::parseDate() from DateConversion to JSDateMath 4 https://bugs.webkit.org/show_bug.cgi?id=91982 5 6 Reviewed by Geoffrey Garen. 7 8 Moveing this function into the other files removes the dependency 9 on JSC spcific classes in DateConversion.{cpp|h}. 10 11 * runtime/DateConversion.cpp: 12 * runtime/DateConversion.h: 13 (JSC): 14 * runtime/JSDateMath.cpp: 15 (JSC::parseDate): 16 (JSC): 17 * runtime/JSDateMath.h: 18 (JSC): 19 1 20 2012-07-23 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/DateConversion.cpp
r100205 r123376 56 56 namespace JSC { 57 57 58 double parseDate(ExecState* exec, const UString &date)59 {60 if (date == exec->globalData().cachedDateString)61 return exec->globalData().cachedDateStringValue;62 double value = parseES5DateFromNullTerminatedCharacters(date.utf8().data());63 if (isnan(value))64 value = parseDateFromNullTerminatedCharacters(exec, date.utf8().data());65 exec->globalData().cachedDateString = date;66 exec->globalData().cachedDateStringValue = value;67 return value;68 }69 70 58 void formatDate(const GregorianDateTime &t, DateConversionBuffer& buffer) 71 59 { -
trunk/Source/JavaScriptCore/runtime/DateConversion.h
r52028 r123376 43 43 #define DateConversion_h 44 44 45 #include "UString.h"46 47 45 namespace JSC { 48 46 … … 53 51 typedef char DateConversionBuffer[DateConversionBufferSize]; 54 52 55 double parseDate(ExecState* exec, const UString&);56 53 void formatDate(const GregorianDateTime&, DateConversionBuffer&); 57 54 void formatDateUTCVariant(const GregorianDateTime&, DateConversionBuffer&); -
trunk/Source/JavaScriptCore/runtime/JSDateMath.cpp
r113313 r123376 260 260 } 261 261 262 double parseDate(ExecState* exec, const UString& date) 263 { 264 if (date == exec->globalData().cachedDateString) 265 return exec->globalData().cachedDateStringValue; 266 double value = parseES5DateFromNullTerminatedCharacters(date.utf8().data()); 267 if (isnan(value)) 268 value = parseDateFromNullTerminatedCharacters(exec, date.utf8().data()); 269 exec->globalData().cachedDateString = date; 270 exec->globalData().cachedDateStringValue = value; 271 return value; 272 } 273 262 274 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSDateMath.h
r113451 r123376 49 49 50 50 class ExecState; 51 class UString; 51 52 struct GregorianDateTime; 52 53 … … 55 56 double getUTCOffset(ExecState*); 56 57 double parseDateFromNullTerminatedCharacters(ExecState*, const char* dateString); 58 double parseDate(ExecState*, const UString&); 57 59 58 60 // Intentionally overridding the default tm of the system.
Note: See TracChangeset
for help on using the changeset viewer.