summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/wtf/DateMath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/wtf/DateMath.cpp')
-rw-r--r--Source/JavaScriptCore/wtf/DateMath.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/wtf/DateMath.cpp b/Source/JavaScriptCore/wtf/DateMath.cpp
index 8873352..062cc1b 100644
--- a/Source/JavaScriptCore/wtf/DateMath.cpp
+++ b/Source/JavaScriptCore/wtf/DateMath.cpp
@@ -76,6 +76,9 @@
#include "ASCIICType.h"
#include "CurrentTime.h"
#include "MathExtras.h"
+#if USE(JSC)
+#include "ScopeChain.h"
+#endif
#include "StdLibExtras.h"
#include "StringExtras.h"
@@ -920,6 +923,14 @@ static double parseDateFromNullTerminatedCharacters(const char* dateString, bool
}
}
}
+
+ // The year may be after the time but before the time zone.
+ if (year <= 0) {
+ if (!parseLong(dateString, &newPosStr, 10, &year))
+ year = 0;
+ dateString = newPosStr;
+ skipSpacesAndComments(dateString);
+ }
// Don't fail if the time zone is missing.
// Some websites omit the time zone (4275206).