Commit 5e0763ef authored by oleg@chromium.org's avatar oleg@chromium.org

Revert change to EquivalentTime in date.js. The checks that I've removed in...

Revert change to EquivalentTime in date.js. The checks that I've removed in the last changed were essential after all.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7657955f
......@@ -114,11 +114,9 @@ function EquivalentTime(t) {
// the actual year if it is in the range 1970..2037
if (t >= 0 && t <= 2.1e12) return t;
// We call the function from runtime.cc directly to avoid extra checks which
// are unneeded.
var day = %DateMakeDay(EquivalentYear(YEAR_FROM_TIME(t)),
MONTH_FROM_TIME(t),
DATE_FROM_TIME(t));
var day = MakeDay(EquivalentYear(YEAR_FROM_TIME(t)),
MONTH_FROM_TIME(t),
DATE_FROM_TIME(t));
return MakeDate(day, TimeWithinDay(t));
}
......
......@@ -4961,6 +4961,9 @@ static Object* Runtime_DateMakeDay(Arguments args) {
month += 12;
}
ASSERT(month >= 0);
ASSERT(month < 12);
static const int base_day = 365*1969 + 1969/4 - 1969/100 + 1969/400;
int year1 = year - 1;
int day_from_year = 365 * year1 + year1 / 4 - year1 / 100 + year1 / 400 -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment