[Webkit-unassigned] [Bug 40820] Values passed to Date() not validated - Invalid values not trapped

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Aug 6 21:10:15 PDT 2011


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


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barraclough at apple.com




--- Comment #2 from Gavin Barraclough <barraclough at apple.com>  2011-08-06 21:10:15 PST ---
(In reply to comment #0)
> PROBLEM STATEMENT : Date constructors automatically convert all date/time values to the corresponding time since Jan1970 without validation of values passed.
> Eg,  Date("July 28, 2010 23:170")
>      Date("July 32, 2010 23:17")
>      Date(2010,1,30,23,170,00,00)
> are all converted to valid dates.
> 
> The values passed should be validated and the fact that there doesn't exist a Feb30 or July32,etc must be detected and reported.

Per ES5 it is not necessary to considered this a bug:

    "The function first attempts to parse the format of the String according to the rules called out in Date Time String Format (15.9.1.15). If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats."

Implementation-specific extended support is explicitly permitted, and other browsers appear to support these dates, so changing our behavior may raise compatibility concerns.  There might be a benefit to developers in validating input here, but this is weakened a little by the fact that it doesn't look like malformed dates are an early in the spec.

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