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

Unified Diff: src/date.js

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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 | « src/d8-posix.cc ('k') | src/dateparser.h » ('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 8618)
+++ src/date.js (working copy)
@@ -981,11 +981,22 @@
function DateToISOString() {
var t = DATE_VALUE(this);
if (NUMBER_IS_NAN(t)) return kInvalidDate;
- return this.getUTCFullYear() +
+ var year = this.getUTCFullYear();
+ var year_string;
+ if (year >= 0 && year <= 9999) {
+ year_string = PadInt(year, 4);
+ } else {
+ if (year < 0) {
+ year_string = "-" + PadInt(-year, 6);
+ } else {
+ year_string = "+" + PadInt(year, 6);
+ }
+ }
+ return year_string +
'-' + PadInt(this.getUTCMonth() + 1, 2) +
- '-' + PadInt(this.getUTCDate(), 2) +
+ '-' + PadInt(this.getUTCDate(), 2) +
'T' + PadInt(this.getUTCHours(), 2) +
- ':' + PadInt(this.getUTCMinutes(), 2) +
+ ':' + PadInt(this.getUTCMinutes(), 2) +
':' + PadInt(this.getUTCSeconds(), 2) +
'.' + PadInt(this.getUTCMilliseconds(), 3) +
'Z';
@@ -995,8 +1006,8 @@
function DateToJSON(key) {
var o = ToObject(this);
var tv = DefaultNumber(o);
- if (IS_NUMBER(tv) && !NUMBER_IS_FINITE(tv)) {
- return null;
+ if (IS_NUMBER(tv) && !NUMBER_IS_FINITE(tv)) {
+ return null;
}
return o.toISOString();
}
Property changes on: src/date.js
___________________________________________________________________
Modified: svn:mergeinfo
Merged /branches/bleeding_edge/src/date.js:r8061-8597
« no previous file with comments | « src/d8-posix.cc ('k') | src/dateparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698