[webkit-reviews] review denied: [Bug 3759] Date object enhancements : [Attachment 2914] Proposed fix

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Mon Jul 18 14:50:36 PDT 2005


Geoffrey Garen <ggaren at apple.com> has denied Carsten Guenther
<cguenther at gmail.com>'s request for review:
Bug 3759: Date object enhancements
http://bugzilla.opendarwin.org/show_bug.cgi?id=3759

Attachment 2914: Proposed fix
http://bugzilla.opendarwin.org/attachment.cgi?id=2914&action=edit

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
This patch causes a regression when you use the form alert(new Date(new
String("1"))).

Generally, the default branch in the patch is incorrect (and was previously).
It would be good to fix it entirely to match the ecma spec: 

15.9.3.2 new Date(value)
The [[Prototype]] property of the newly constructed object is set to the
original Date prototype object, the one that is the initial value of
Date.prototype (15.9.4.1).

The [[Class]] property of the newly constructed object is set to "Date".

The [[Value]] property of the newly constructed object is set as follows:

1. Call ToPrimitive(value).

2. If Type(Result(1)) is String, then go to step 5.

3. Let V be ToNumber(Result(1)).

4. Set the [[Value]] property of the newly constructed object to TimeClip(V)
and return.

5. Parse Result(1) as a date, in exactly the same manner as for the parse
method (15.9.4.2); let V be the time value for this date.

6. Go to step 4.



More information about the webkit-reviews mailing list