Bug 75892 - Possible bug: Number(new Date(1,1,1,1,1,1,1))
Summary: Possible bug: Number(new Date(1,1,1,1,1,1,1))
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 75692
  Show dependency treegraph
Reported: 2012-01-09 14:47 PST by Gavin Barraclough
Modified: 2012-02-01 11:41 PST (History)
6 users (show)

See Also:

Fixed some lines in the test (5.72 KB, patch)
2012-02-01 02:14 PST, Szilard Ledan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 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.
Comment 1 Szilard Ledan 2012-02-01 02:14:55 PST
Created attachment 124912 [details]
Fixed some lines in the test
Comment 2 Csaba Osztrogonác 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: 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
Comment 3 Darin Adler 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.
Comment 4 Gavin Barraclough 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.
Comment 5 WebKit Review Bot 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>
Comment 6 WebKit Review Bot 2012-02-01 11:41:22 PST
All reviewed patches have been landed.  Closing bug.