diff options
5 files changed, 26 insertions, 0 deletions
diff --git a/third_party/WebKit/JavaScriptCore/ChangeLog b/third_party/WebKit/JavaScriptCore/ChangeLog index 8a7fe17..94b65f6 100644 --- a/third_party/WebKit/JavaScriptCore/ChangeLog +++ b/third_party/WebKit/JavaScriptCore/ChangeLog @@ -1,3 +1,15 @@ +2010-08-11 Leo Yang <leo.yang@torchmobile.com.cn> + + Reviewed by Geoffrey Garen. + + Date("") should be an invalid date. For IE, Firefox and Chrome, Date("") is invalid date, + which means isNaN(new Date("")) should return true. + https://bugs.webkit.org/show_bug.cgi?id=43793 + Tests: fast/js/date-constructor.html + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::resetDateCache): + 2010-08-11 Gavin Barraclough <barraclough@apple.com> Windows & !JIT build fix. diff --git a/third_party/WebKit/JavaScriptCore/runtime/JSGlobalData.cpp b/third_party/WebKit/JavaScriptCore/runtime/JSGlobalData.cpp index abb2db2..ca8605b 100644 --- a/third_party/WebKit/JavaScriptCore/runtime/JSGlobalData.cpp +++ b/third_party/WebKit/JavaScriptCore/runtime/JSGlobalData.cpp @@ -283,6 +283,7 @@ void JSGlobalData::resetDateCache() cachedUTCOffset = NaN; dstOffsetCache.reset(); cachedDateString = UString(); + cachedDateStringValue = NaN; dateInstanceCache.reset(); } diff --git a/third_party/WebKit/LayoutTests/ChangeLog b/third_party/WebKit/LayoutTests/ChangeLog index 3b2845e..e079b52 100644 --- a/third_party/WebKit/LayoutTests/ChangeLog +++ b/third_party/WebKit/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2010-08-11 Leo Yang <leo.yang@torchmobile.com.cn> + + Reviewed by Geoffrey Garen. + + Add isNaN(new Date("")) test to fast/js/script-tests/date-constructor.js. + https://bugs.webkit.org/show_bug.cgi?id=43793 + + * fast/js/date-constructor-expected.txt: + * fast/js/script-tests/date-constructor.js: + 2010-08-11 Kenneth Russell <kbr@google.com> Reviewed by David Levin. diff --git a/third_party/WebKit/LayoutTests/fast/js/date-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/js/date-constructor-expected.txt index 7bdb8d5..233c999 100644 --- a/third_party/WebKit/LayoutTests/fast/js/date-constructor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/js/date-constructor-expected.txt @@ -3,6 +3,7 @@ This test case tests the Date constructor. In particular, it tests many cases of On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". +PASS isNaN(new Date("")) is true PASS new Date(1111).getTime() is 1111 PASS new Date(object).getTime() is 1111 PASS new Date(new Date(1111)).getTime() is 1111 diff --git a/third_party/WebKit/LayoutTests/fast/js/script-tests/date-constructor.js b/third_party/WebKit/LayoutTests/fast/js/script-tests/date-constructor.js index 7b214630..ffe0b0a 100644 --- a/third_party/WebKit/LayoutTests/fast/js/script-tests/date-constructor.js +++ b/third_party/WebKit/LayoutTests/fast/js/script-tests/date-constructor.js @@ -8,6 +8,8 @@ var object = new Object; object.valueOf = function() { return 1111; } object.toSTring = function() { return "2222"; } +shouldBe('isNaN(new Date(""))', 'true'); + var timeZoneOffset = Date.parse("Dec 25 1995") - Date.parse("Dec 25 1995 GMT"); shouldBe('new Date(1111).getTime()', '1111'); |