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

Issue 8392036: Fix error handling in Date.prototype.toISOString. (Closed)

Created:
9 years, 1 month ago by Michael Starzinger
Modified:
9 years, 1 month ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Fix error handling in Date.prototype.toISOString. This fixes Date.prototyoe.toISOString to throw a RangeError exception for invalid time values. It also includes a fix to removes the arbitrary (and completely bogus) range limit on the date value during construction of a Date object. Note that we still have bogus range limits on the year and month values. R=lrn@chromium.org BUG=v8:1792 TEST=mjsunit/date,test262/15.9.5.43-0-* Committed: http://code.google.com/p/v8/source/detail?r=9829

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix error handling in Date.prototype.toISOString. #

Total comments: 3

Patch Set 3 : Addressed comments by Lasse Reichstein. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -46 lines) Patch
M src/date.js View 1 2 chunks +5 lines, -5 lines 0 comments Download
M src/macros.py View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/messages.js View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 1 2 6 chunks +11 lines, -12 lines 0 comments Download
M test/mjsunit/date.js View 1 3 chunks +13 lines, -2 lines 0 comments Download
M test/test262/test262.status View 1 2 chunks +0 lines, -24 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Michael Starzinger
PTAL.
9 years, 1 month ago (2011-10-26 15:11:44 UTC) #1
Lasse Reichstein
While we match the current state of Safari, I can see that both Firefox 6. ...
9 years, 1 month ago (2011-10-27 07:11:01 UTC) #2
Michael Starzinger
Added new patch set that actually fixes the issue. Updated description. PTAL.
9 years, 1 month ago (2011-10-27 15:12:08 UTC) #3
Lasse Reichstein
LGTM! http://codereview.chromium.org/8392036/diff/5001/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/8392036/diff/5001/src/runtime.cc#newcode7530 src/runtime.cc:7530: if (year % 4 || (year % 100 ...
9 years, 1 month ago (2011-10-28 07:20:54 UTC) #4
Michael Starzinger
9 years, 1 month ago (2011-10-28 08:46:35 UTC) #5
Added new patch set. Landed.

http://codereview.chromium.org/8392036/diff/5001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/8392036/diff/5001/src/runtime.cc#newcode7530
src/runtime.cc:7530: if (year % 4 || (year % 100 == 0 && year % 400 != 0)) {
On 2011/10/28 07:20:54, Lasse Reichstein wrote:
> Could we make this ((year % 4) != 0 || ....
> I dislike implicit interger->boolean conversion :)

Done.

Powered by Google App Engine
This is Rietveld 408576698