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

Unified Diff: src/date.js

Issue 1075016: Fix bug http://code.google.com/p/v8/issues/detail?id=659. Move the limits che... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
===================================================================
--- src/date.js (revision 4222)
+++ src/date.js (working copy)
@@ -223,6 +223,10 @@
}
function LocalTimeNoCheck(time) {
+ if (time < -MAX_TIME_MS || time > MAX_TIME_MS) {
+ return $NaN;
+ }
+
// Inline the DST offset cache checks for speed.
var cache = DST_offset_cache;
if (cache.start <= time && time <= cache.end) {
@@ -265,8 +269,7 @@
function YearFromTime(t) {
if (t !== ymd_from_time_cached_time) {
- // Limits according to ECMA 262 15.9.1.1
- if (!$isFinite(t) || t < -8640000000000000 || t > 8640000000000000) {
+ if (!$isFinite(t)) {
return $NaN;
}
@@ -279,8 +282,7 @@
function MonthFromTime(t) {
if (t !== ymd_from_time_cached_time) {
- // Limits according to ECMA 262 15.9.1.1
- if (!$isFinite(t) || t < -8640000000000000 || t > 8640000000000000) {
+ if (!$isFinite(t)) {
return $NaN;
}
%DateYMDFromTime(t, ymd_from_time_cache);
@@ -292,8 +294,7 @@
function DateFromTime(t) {
if (t !== ymd_from_time_cached_time) {
- // Limits according to ECMA 262 15.9.1.1
- if (!$isFinite(t) || t < -8640000000000000 || t > 8640000000000000) {
+ if (!$isFinite(t)) {
return $NaN;
}
« no previous file with comments | « no previous file | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698