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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 30 01:12:57 PDT 2012


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





--- Comment #2 from Kent Tamura <tkent at chromium.org>  2012-05-30 01:12:57 PST ---
(In reply to comment #1)
> (In reply to comment #0)
> > 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.
> 
> Our binding code already supports NaN -> null Date mapping.

Ah, you mean 0->null mapping?
I think we can use ImplementedAs to avoid custom binding code.

readonly attribute [ImplementedAs=lastModifiedDateForBinding] Date lastModifiedDate;

double lastModifiedDateForBinding()
{
    double value = lastModifiedDate();
    return !value ? std::numeric_limits:quiet_nan() : value;
}

-- 
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