Correct issue 696 with Date.parse returning a value when called on a non date string.
authorricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 7 May 2010 11:53:20 +0000 (11:53 +0000)
committerricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 7 May 2010 11:53:20 +0000 (11:53 +0000)
commitfb3e01a30697d06e9e3886537a694709bc8ec9e1
tree2d81a681ec2a5e63225e9b741db7bd51ae45eefc
parent876c3e06b5f4365b7d1a8bc4932bbcdc0f5d09cc
Correct issue 696 with Date.parse returning a value when called on a non date string.

The error was introduced in revision 4557 where support was added for
ES5 date time format strings. Because there was no check for a valid
year a random string starting with a non-digit character would be
parsed.

This change disallows ES5 formatted dates where there is no date
fraction (i.e., with only a timestamp). Since none of the other
browsers support Date.parse on only timestamps I have disabled this
totally instead of just correcting the parser.

Review URL: http://codereview.chromium.org/2017005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4613 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/dateparser.cc
test/mjsunit/regress/regress-696.js [new file with mode: 0644]