summaryrefslogtreecommitdiff
path: root/src/3rdparty/javascriptcore/JavaScriptCore/runtime
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-09-19 15:34:59 +0400
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-09-22 14:32:17 +0200
commit5b87292cbc4f3b94ed6426c526c4f3dcca3eaa55 (patch)
treeae74d2e9cd90d503ae179e83616e278d19374b39 /src/3rdparty/javascriptcore/JavaScriptCore/runtime
parentdd8b0a0df9b12aae4c55e6bd548b5af5175dc818 (diff)
downloadqtscript-5b87292cbc4f3b94ed6426c526c4f3dcca3eaa55.tar.gz
Fix DateTime with recent versions of tzdata
An backport of http://trac.webkit.org/changeset/150833 needed for correct time KRAT, YAKT and MOS timezones. Change-Id: I3b5369d1427757c0d638865324a36e43dcaa60bf Task-number: QTBUG-41422 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/runtime')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConstructor.cpp6
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp4
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h18
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;