RESOLVED FIXED 75892
Possible bug: Number(new Date(1,1,1,1,1,1,1))
https://bugs.webkit.org/show_bug.cgi?id=75892
Summary Possible bug: Number(new Date(1,1,1,1,1,1,1))
Gavin Barraclough
Reported 2012-01-09 14:47:40 PST
I landed this in a test case and it looks like our results differ on OS X & Linux. This may indicate a bug. Firefox produces a still different result, but it looks like they have a bug (since they seem to be using historic information which is prohibited by the spec), so looks like we can't use them as a referee on the matter. :-) We should investigate further at some point & see if there is a real bug here, might have just been a lousy test case by me that failed to take timezone into account correctly.
Attachments
Fixed some lines in the test (5.72 KB, patch)
2012-02-01 02:14 PST, Szilard Ledan
no flags
Szilard Ledan
Comment 1 2012-02-01 02:14:55 PST
Created attachment 124912 [details] Fixed some lines in the test
Csaba Osztrogonác
Comment 2 2012-02-01 02:34:26 PST
This test introduced in http://trac.webkit.org/changeset/12446 (https://bugs.webkit.org/show_bug.cgi?id=6870) 6 years ago. ECMA-262 said that the constructor of Date() has 7 parameters: 15.9.2.1 Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] ) But in this test you pass 9 parameters instead of 7. I think the 8th and 9th parameter is absolutely useless, and they are passed accidentally by r12446. Darin (as the author) or John (as the reviewer), could you confirm that we should remove useless 8th and 9th parameters in this testcase? PS. The discussion was started in https://bugs.webkit.org/show_bug.cgi?id=75692
Darin Adler
Comment 3 2012-02-01 10:30:15 PST
I do think that passing too many arguments in that test was just a programming error I made in 2006. However, we should have test cases covering what happens when you pass too many arguments; there is defined required behavior and we should test for it. If we remove the accidental testing, we should add make sure we keep intentional testing of extra arguments somewhere and have the correct behavior.
Gavin Barraclough
Comment 4 2012-02-01 10:54:00 PST
Actually, the extra arguments on the lines in question were added in r104267 ( http://trac.webkit.org/changeset/104267 ), in part to deliberately provide additional testing of extra arguments being passed. We could split these out into two sets of tests, one for infinities, one for too many arguments, but there is a correlation here (albeit weak) – in that extra arguments of Infinity is one that could through programmer error be construed as an error, but shouldn't be. Let's leave this alone.
WebKit Review Bot
Comment 5 2012-02-01 11:41:16 PST
Comment on attachment 124912 [details] Fixed some lines in the test Clearing flags on attachment: 124912 Committed r106480: <http://trac.webkit.org/changeset/106480>
WebKit Review Bot
Comment 6 2012-02-01 11:41:22 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.