Review URL: http://codereview.chromium.org/660375
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3999
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// 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));
}
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 -