Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Issue 2017005: Correct issue 696 with Date.parse returning a value when called on a non date... (Closed)

Created:
10 years, 7 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein
CC:
Kasper Lund
Visibility:
Public.

Description

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. Committed: http://code.google.com/p/v8/source/detail?r=4613

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -11 lines) Patch
M src/dateparser.cc View 1 2 chunks +5 lines, -11 lines 0 comments Download
A test/mjsunit/regress/regress-696.js View 3 4 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Rico
I discussed quite a bit with lasse about how to best support Date.parse on timestamps ...
10 years, 7 months ago (2010-05-07 10:42:13 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/2017005/diff/1/2 File src/dateparser.cc (right): http://codereview.chromium.org/2017005/diff/1/2#newcode47 src/dateparser.cc:47: if (index_ < 2) return false; Drop this ...
10 years, 7 months ago (2010-05-07 11:21:59 UTC) #2
Rico
Added regression test, please take another look http://codereview.chromium.org/2017005/diff/1/2 File src/dateparser.cc (right): http://codereview.chromium.org/2017005/diff/1/2#newcode47 src/dateparser.cc:47: if (index_ ...
10 years, 7 months ago (2010-05-07 11:35:55 UTC) #3
Rico
Added regression test, please take another look
10 years, 7 months ago (2010-05-07 11:35:56 UTC) #4
Lasse Reichstein
10 years, 7 months ago (2010-05-07 11:39:08 UTC) #5
LGTM, if you put in a comment that the current behavior isn't ES5 compliant.

Powered by Google App Engine
This is Rietveld 408576698