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

Side by Side Diff: src/date-delay.js

Issue 8733: Merged bleeding_edge r599:645 into regexp2000. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month 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 | « src/compiler.cc ('k') | src/execution.cc » ('j') | 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 510
511 function DateString(time) { 511 function DateString(time) {
512 var YMD = FromJulianDay(Day(time) + kDayZeroInJulianDay); 512 var YMD = FromJulianDay(Day(time) + kDayZeroInJulianDay);
513 return WeekDays[WeekDay(time)] + ' ' 513 return WeekDays[WeekDay(time)] + ' '
514 + Months[YMD.month] + ' ' 514 + Months[YMD.month] + ' '
515 + TwoDigitString(YMD.date) + ' ' 515 + TwoDigitString(YMD.date) + ' '
516 + YMD.year; 516 + YMD.year;
517 } 517 }
518 518
519 519
520 var LongWeekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Fri day', 'Saturday'];
521 var LongMonths = ['January', 'February', 'March', 'April', 'May', 'June', 'July' , 'August', 'September', 'October', 'November', 'December'];
522
523
524 function LongDateString(time) {
525 var YMD = FromJulianDay(Day(time) + kDayZeroInJulianDay);
526 return LongWeekDays[WeekDay(time)] + ', '
527 + LongMonths[YMD.month] + ' '
528 + TwoDigitString(YMD.date) + ', '
529 + YMD.year;
530 }
531
532
520 function TimeString(time) { 533 function TimeString(time) {
521 return TwoDigitString(HourFromTime(time)) + ':' 534 return TwoDigitString(HourFromTime(time)) + ':'
522 + TwoDigitString(MinFromTime(time)) + ':' 535 + TwoDigitString(MinFromTime(time)) + ':'
523 + TwoDigitString(SecFromTime(time)); 536 + TwoDigitString(SecFromTime(time));
524 } 537 }
525 538
526 539
527 function LocalTimezoneString(time) { 540 function LocalTimezoneString(time) {
528 var timezoneOffset = (local_time_offset + DaylightSavingsOffset(time)) / msPer Minute; 541 var timezoneOffset = (local_time_offset + DaylightSavingsOffset(time)) / msPer Minute;
529 var sign = (timezoneOffset >= 0) ? 1 : -1; 542 var sign = (timezoneOffset >= 0) ? 1 : -1;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 622
610 623
611 // ECMA 262 - 15.9.5.5 624 // ECMA 262 - 15.9.5.5
612 function DateToLocaleString() { 625 function DateToLocaleString() {
613 return DateToString.call(this); 626 return DateToString.call(this);
614 } 627 }
615 628
616 629
617 // ECMA 262 - 15.9.5.6 630 // ECMA 262 - 15.9.5.6
618 function DateToLocaleDateString() { 631 function DateToLocaleDateString() {
619 return DateToDateString.call(this); 632 var t = GetTimeFrom(this);
633 if ($isNaN(t)) return kInvalidDate;
634 return LongDateString(LocalTimeNoCheck(t));
620 } 635 }
621 636
622 637
623 // ECMA 262 - 15.9.5.7 638 // ECMA 262 - 15.9.5.7
624 function DateToLocaleTimeString() { 639 function DateToLocaleTimeString() {
625 var t = GetTimeFrom(this); 640 var t = GetTimeFrom(this);
626 if ($isNaN(t)) return kInvalidDate; 641 if ($isNaN(t)) return kInvalidDate;
627 var lt = LocalTimeNoCheck(t); 642 var lt = LocalTimeNoCheck(t);
628 return TimeString(lt); 643 return TimeString(lt);
629 } 644 }
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 "setFullYear", DateSetFullYear, 1026 "setFullYear", DateSetFullYear,
1012 "setUTCFullYear", DateSetUTCFullYear, 1027 "setUTCFullYear", DateSetUTCFullYear,
1013 "toGMTString", DateToGMTString, 1028 "toGMTString", DateToGMTString,
1014 "toUTCString", DateToUTCString, 1029 "toUTCString", DateToUTCString,
1015 "getYear", DateGetYear, 1030 "getYear", DateGetYear,
1016 "setYear", DateSetYear 1031 "setYear", DateSetYear
1017 )); 1032 ));
1018 } 1033 }
1019 1034
1020 SetupDate(); 1035 SetupDate();
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698