diff options
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/runtime')
3 files changed, 13 insertions, 15 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConstructor.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConstructor.cpp index e9a5c29..532eedb 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConstructor.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConstructor.cpp @@ -129,10 +129,8 @@ ConstructType DateConstructor::getConstructData(ConstructData& constructData) // ECMA 15.9.2 static JSValue JSC_HOST_CALL callDate(ExecState* exec, JSObject*, JSValue, const ArgList&) { - time_t localTime = time(0); - tm localTM; - getLocalTime(&localTime, &localTM); - GregorianDateTime ts(exec, localTM); + GregorianDateTime ts; + msToGregorianDateTime(exec, currentTimeMS(), false, ts); DateConversionBuffer date; DateConversionBuffer time; formatDate(ts, date); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp index 1c25c16..f90d495 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp @@ -143,7 +143,6 @@ JSGlobalData::JSGlobalData(bool isShared) , functionCodeBlockBeingReparsed(0) , firstStringifierToMark(0) , markStack(jsArrayVPtr) - , cachedUTCOffset(NaN) #ifndef NDEBUG , mainThreadOnly(false) #endif @@ -259,8 +258,7 @@ JSGlobalData::ClientData::~ClientData() void JSGlobalData::resetDateCache() { - cachedUTCOffset = NaN; - dstOffsetCache.reset(); + localTimeOffsetCache.reset(); cachedDateString = UString(); dateInstanceCache.reset(); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h index e38a2bc..6431978 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h @@ -39,6 +39,7 @@ #include "SmallStrings.h" #include "TimeoutChecker.h" #include "WeakRandom.h" +#include <wtf/DateMath.h> #include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/RefCounted.h> @@ -63,21 +64,23 @@ namespace JSC { struct HashTable; struct Instruction; - struct DSTOffsetCache { - DSTOffsetCache() + struct LocalTimeOffsetCache { + LocalTimeOffsetCache() + : start(0.0) + , end(-1.0) + , increment(0.0) { - reset(); } - + void reset() { - offset = 0.0; + offset = LocalTimeOffset(); start = 0.0; end = -1.0; increment = 0.0; } - double offset; + LocalTimeOffset offset; double start; double end; double increment; @@ -180,8 +183,7 @@ namespace JSC { MarkStack markStack; - double cachedUTCOffset; - DSTOffsetCache dstOffsetCache; + LocalTimeOffsetCache localTimeOffsetCache; UString cachedDateString; double cachedDateStringValue; |