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

Unified Diff: src/date.js

Issue 1387293002: TimeClip converts -0 to +0, following ES2015 spec (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
diff --git a/src/date.js b/src/date.js
index a39e538821cb57eddc0447c444b2b0f1c78f83a8..44e8f56e71b05926cdd7ef7f278165d416c2db98 100644
--- a/src/date.js
+++ b/src/date.js
@@ -116,7 +116,7 @@ function MakeDate(day, time) {
function TimeClip(time) {
if (!IsFinite(time)) return NAN;
if (MathAbs(time) > MAX_TIME_MS) return NAN;
- return TO_INTEGER(time);
+ return TO_INTEGER(time) + 0;
}
@@ -144,7 +144,7 @@ function DateConstructor(year, month, date, hours, minutes, seconds, ms) {
SET_UTC_DATE_VALUE(this, value);
} else if (argc == 1) {
if (IS_NUMBER(year)) {
- value = year;
+ value = TimeClip(year);
} else if (IS_STRING(year)) {
// Probe the Date cache. If we already have a time value for the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698