Bug 43793

Summary: Date("") should be an invalid date time
Product: WebKit Reporter: Leo Yang <leo.yang>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, staikos
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
ggaren: review-
Patch - fix commit message and comments none

Leo Yang
Reported 2010-08-10 08:09:45 PDT
Date("") should be an invalid date time. isNaN(new Date("")) should return true.
Attachments
Patch (3.56 KB, patch)
2010-08-10 08:21 PDT, Leo Yang
ggaren: review-
Patch - fix commit message and comments (3.83 KB, patch)
2010-08-11 07:28 PDT, Leo Yang
no flags
Leo Yang
Comment 1 2010-08-10 08:21:13 PDT
Geoffrey Garen
Comment 2 2010-08-10 10:48:36 PDT
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.
Leo Yang
Comment 3 2010-08-10 11:09:35 PDT
(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.
Leo Yang
Comment 4 2010-08-11 07:28:37 PDT
Created attachment 64112 [details] Patch - fix commit message and comments
Geoffrey Garen
Comment 5 2010-08-11 12:16:45 PDT
Comment on attachment 64112 [details] Patch - fix commit message and comments r=me
WebKit Commit Bot
Comment 6 2010-08-11 17:31:35 PDT
Comment on attachment 64112 [details] Patch - fix commit message and comments Clearing flags on attachment: 64112 Committed r65201: <http://trac.webkit.org/changeset/65201>
WebKit Commit Bot
Comment 7 2010-08-11 17:31:39 PDT
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.