[Webkit-unassigned] [Bug 87826] New: We should use NaN or separate boolean flag for null Date value

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 29 23:37:59 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=87826

           Summary: We should use NaN or separate boolean flag for null
                    Date value
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: kinuko at chromium.org
                CC: darin at apple.com


Currently we use the value 0 (in double) to indicate uninitialized or invalid Date value at several places, but this could be a valid date value as 0 epoch time (i.e. Jan 1 1970) and the binding code just returns Date(0) unless we use custom binding, while null should be returned instead.

We should probably use NaN instead 0 (which is automatically converted to Date null) to indicate uninitialized Date value, or should have some binding machinery support to return null.

This issue is separated from issue 87709.
https://bugs.webkit.org/show_bug.cgi?id=87709#c10

"Seems like it would be better to use a separate boolean or a NaN to represent the fact that a date is not available rather than using the number 0.

Generally speaking, instead of a custom binding, I’d like to see our binding machinery support this ability to return null for a date, perhaps by having the date-returning internal DOM functions return a boolean and use an out argument for the date, or something else along those lines."

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list