Summary: | Date("") should be an invalid date time | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Leo Yang <leo.yang> | ||||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, staikos | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Leo Yang
2010-08-10 08:09:45 PDT
Created attachment 64013 [details]
Patch
Comment on attachment 64013 [details] Patch Why should new Date("") be NaN? Can you point to a part of a spec, or the behavior of another browser? As a general rule, it's better for your ChangeLog to explain the why, rather than the what. > cachedDateString = UString(); > + cachedDateStringValue = NaN; Can you explain why you needed to make this change? UString() should not be == to UString(""). If it is, I think we have another bug to solve. (In reply to comment #2) > (From update of attachment 64013 [details]) > Why should new Date("") be NaN? Can you point to a part of a spec, or the behavior of another browser? As a general rule, it's better for your ChangeLog to explain the why, rather than the what. For IE and FireFox, new Date("") is NaN. > > > cachedDateString = UString(); > > + cachedDateStringValue = NaN; > > Can you explain why you needed to make this change? There isn't initial value for cachedDateStringValue. Do we depend on the first assignment when Date cache is hit? After we call restDateCache(), we leave cachedDateStringValue and reset cachedDateString, it's not consistent. > > UString() should not be == to UString(""). If it is, I think we have another bug to solve. Yes, I don't know why UString() == UString(""). This also need to be fixed. Created attachment 64112 [details]
Patch - fix commit message and comments
Comment on attachment 64112 [details]
Patch - fix commit message and comments
r=me
Comment on attachment 64112 [details] Patch - fix commit message and comments Clearing flags on attachment: 64112 Committed r65201: <http://trac.webkit.org/changeset/65201> All reviewed patches have been landed. Closing bug. |