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

Issue 5905003: Perform more aggressive time to NaN conversions. Our internal date... (Closed)

Created:
10 years ago by Mads Ager (chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Perform more aggressive time to NaN conversions. Our internal date methods rely on the time values passed in being within a certain range - not significantly larger than the the ECMA 262 specified time range. When creating a time, always make it NaN if there is no way that it can be within range even after UTC conversion. Committed: http://code.google.com/p/v8/source/detail?r=6048

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -37 lines) Patch
M src/date.js View 1 19 chunks +33 lines, -31 lines 1 comment Download
M src/macros.py View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M test/mjsunit/date.js View 2 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mads Ager (chromium)
10 years ago (2010-12-16 09:52:54 UTC) #1
Mads Ager (chromium)
Redirecting since Erik is out.
10 years ago (2010-12-16 11:05:11 UTC) #2
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/5905003/diff/5001/src/date.js File src/date.js (right): http://codereview.chromium.org/5905003/diff/5001/src/date.js#newcode371 src/date.js:371: var time = day * msPerDay + time; ...
10 years ago (2010-12-16 11:38:30 UTC) #3
William Hesse
10 years ago (2010-12-16 18:56:51 UTC) #4
If the only time a NaN value is assigned to a Date object is explicitly in our
code, maybe the test for NaN in all the Date methods could be replaced with a
faster check for exact equality with that particular NaN.  This would need to be
an inlined method.


On 2010/12/16 11:38:30, Søren Gjesse wrote:
> LGTM
> 
> http://codereview.chromium.org/5905003/diff/5001/src/date.js
> File src/date.js (right):
> 
> http://codereview.chromium.org/5905003/diff/5001/src/date.js#newcode371
> src/date.js:371: var time = day * msPerDay + time;
> As you mentioned offline please add tests where day and time have different
> Infinity/-Infinity values to ensure NaN is returned.

Powered by Google App Engine
This is Rietveld 408576698