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

Side by Side Diff: src/date.js

Issue 89353002: Add ES specification reference to DateNow. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ms = argc > 6 ? ToNumber(ms) : 0; 295 ms = argc > 6 ? ToNumber(ms) : 0;
296 year = (!NUMBER_IS_NAN(year) && 296 year = (!NUMBER_IS_NAN(year) &&
297 0 <= TO_INTEGER(year) && 297 0 <= TO_INTEGER(year) &&
298 TO_INTEGER(year) <= 99) ? 1900 + TO_INTEGER(year) : year; 298 TO_INTEGER(year) <= 99) ? 1900 + TO_INTEGER(year) : year;
299 var day = MakeDay(year, month, date); 299 var day = MakeDay(year, month, date);
300 var time = MakeTime(hours, minutes, seconds, ms); 300 var time = MakeTime(hours, minutes, seconds, ms);
301 return TimeClip(MakeDate(day, time)); 301 return TimeClip(MakeDate(day, time));
302 } 302 }
303 303
304 304
305 // Mozilla-specific extension. Returns the number of milliseconds 305 // ECMA 262 - 15.9.4.4
306 // elapsed since 1 January 1970 00:00:00 UTC.
307 function DateNow() { 306 function DateNow() {
308 return %DateCurrentTime(); 307 return %DateCurrentTime();
309 } 308 }
310 309
311 310
312 // ECMA 262 - 15.9.5.2 311 // ECMA 262 - 15.9.5.2
313 function DateToString() { 312 function DateToString() {
314 var t = UTC_DATE_VALUE(this) 313 var t = UTC_DATE_VALUE(this)
315 if (NUMBER_IS_NAN(t)) return kInvalidDate; 314 if (NUMBER_IS_NAN(t)) return kInvalidDate;
316 var time_zone_string = LocalTimezoneString(this) 315 var time_zone_string = LocalTimezoneString(this)
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 "toGMTString", DateToGMTString, 819 "toGMTString", DateToGMTString,
821 "toUTCString", DateToUTCString, 820 "toUTCString", DateToUTCString,
822 "getYear", DateGetYear, 821 "getYear", DateGetYear,
823 "setYear", DateSetYear, 822 "setYear", DateSetYear,
824 "toISOString", DateToISOString, 823 "toISOString", DateToISOString,
825 "toJSON", DateToJSON 824 "toJSON", DateToJSON
826 )); 825 ));
827 } 826 }
828 827
829 SetUpDate(); 828 SetUpDate();
OLDNEW
« 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