Version: (using KDE KDE 3.5.5) Installed from: Compiled From Sources Compiler: gcc version 4.1.1 (Gentoo 4.1.1) OS: Linux On "http://www.bbc.co.uk/weather/ukweather/" javascript (I assume) can give a slideshow of the next few days weather. The initial page does not display correctly and neither do the choices below (except for text summary of course). When debugging is allowed several errors appear at http://www.bbc.co.uk/weather/jsglobal/mappresenter/slideshowdatauk.js?11 line 419 This used to work in kde 3.5.3 and kde 3.5.2 but not in kde 3.5.4. Seamonkey works O/K on these pages.
Testcase: g_now = new Date(); g_now.setTime(NaN); g_now.setTime(Date.parse("November 7, 2006 14:00:00")); Somehow the second setTime doesn't go through after the first one...
Created attachment 18457 [details] patch This should fix it --- setTime doesn't rely on the internal value, so no reason to disallow it if the internal value is NaN.
SVN commit 603353 by orlovich: Regression test for #136992, and the bug the fix for which introduced this bug... CCBUG:136992 M +6 -0 Date.js --- trunk/tests/khtmltests/regression/tests/js/Date.js #603352:603353 @@ -317,4 +317,10 @@ shouldBe("new Date('00/00/2006').toString()", "new Date('Nov 30 2005').toString()"); shouldBe("new Date('01/452/2006').toString()", "new Date('Mar 28 2007').toString()"); +// Not crashing when trying set* ops on NaNs +shouldBeTrue("isNaN(new Date(NaN).setFullYear(1900))"); + +//... but should permit doing setTime on NaN (#136992) +shouldBe("new Date(NaN).setTime(1162939650000)", "1162939650000"); + debug("End Of Test");
SVN commit 603351 by orlovich: Permit changing the internal value of invalid dates. Fixes the BBC UK Weather page.. BUG:136992 M +6 -6 date_object.cpp --- branches/KDE/3.5/kdelibs/kjs/date_object.cpp #603350:603351 @@ -417,7 +417,6 @@ case GetSeconds: case GetMilliSeconds: case GetTimezoneOffset: - case SetTime: case SetMilliSeconds: case SetSeconds: case SetMinutes: @@ -429,6 +428,12 @@ } } + if (id == SetTime) { + result = Number(roundValue(exec,args[0])); + thisObj.setInternalValue(result); + return result; + } + // check whether time value is outside time_t's usual range // make the necessary transformations if necessary int realYearOffset = 0; @@ -538,11 +543,6 @@ case GetTimezoneOffset: result = Number(timeZoneOffset(t)); break; - case SetTime: - milli = roundValue(exec,args[0]); - result = Number(milli); - thisObj.setInternalValue(result); - break; case SetMilliSeconds: fillStructuresUsingTimeArgs(exec, args, 1, &ms, t); break;