VERIFIED FIXED 6870
REGRESSION: JavaScript Date constructor won't accept another Date object
https://bugs.webkit.org/show_bug.cgi?id=6870
Summary REGRESSION: JavaScript Date constructor won't accept another Date object
andrew
Reported 2006-01-27 02:29:47 PST
Go to www.qantas.com.au. Click on the tab labelled "International" and you'll find you can't select departure dates at all.
Attachments
Test case v1 (241 bytes, text/html)
2006-01-27 20:07 PST, David Kilzer (:ddkilzer)
no flags
patch to fix bug, including a test (10.32 KB, patch)
2006-01-28 20:25 PST, Darin Adler
sullivan: review+
Joost de Valk (AlthA)
Comment 1 2006-01-27 04:05:59 PST
Confirmed, this one needs reduction.
David Kilzer (:ddkilzer)
Comment 2 2006-01-27 05:12:37 PST
This is a regression. Works for me in Safari 2.0.3 (417.8) on 10.4.4.
Joost de Valk (AlthA)
Comment 3 2006-01-27 05:16:27 PST
If it's a regression, it should be P1 :)
David Kilzer (:ddkilzer)
Comment 4 2006-01-27 18:55:02 PST
This is broken in WebKit-CVS-2005-10-01 03-27-01 GMT.dmg, the very first nightly build available. It broke between the time WebKit was open-sourced and the date on the above nightly.
David Kilzer (:ddkilzer)
Comment 5 2006-01-27 20:07:17 PST
Created attachment 6035 [details] Test case v1
David Kilzer (:ddkilzer)
Comment 6 2006-01-27 20:11:08 PST
The Date object in JavaScript won't accept another Date object in a single-argument constructor: var d = new Date(new Date()); // Results in "Invalid Date" Works correctly in Firefox 1.5 and Safari 2.0.3 (417.8) on 10.4.4.
Darin Adler
Comment 7 2006-01-28 19:18:45 PST
I've got a fix. The Date constructor was not following the algorithm from the JavaScript specification properly. It was supposed to convert to a primitive, then check to see if the result is a string. Instead it was checking to see if the result was a string first.
Darin Adler
Comment 8 2006-01-28 20:25:49 PST
Created attachment 6060 [details] patch to fix bug, including a test
David Kilzer (:ddkilzer)
Comment 9 2006-01-31 05:56:17 PST
Verified fix.
Eric Seidel (no email)
Comment 10 2006-01-31 21:20:57 PST
Removing Regression keyword from bugs already fixed.
David Kilzer (:ddkilzer)
Comment 11 2006-02-26 04:20:17 PST
Added back removed keywords.
Note You need to log in before you can comment on or make changes to this bug.