OLD | NEW |
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 // elapsed since 1 January 1970 00:00:00 UTC. | 661 // elapsed since 1 January 1970 00:00:00 UTC. |
662 function DateNow() { | 662 function DateNow() { |
663 return %DateCurrentTime(); | 663 return %DateCurrentTime(); |
664 } | 664 } |
665 | 665 |
666 | 666 |
667 // ECMA 262 - 15.9.5.2 | 667 // ECMA 262 - 15.9.5.2 |
668 function DateToString() { | 668 function DateToString() { |
669 var t = DATE_VALUE(this); | 669 var t = DATE_VALUE(this); |
670 if (NUMBER_IS_NAN(t)) return kInvalidDate; | 670 if (NUMBER_IS_NAN(t)) return kInvalidDate; |
671 return DatePrintString(LocalTimeNoCheck(t)) + LocalTimezoneString(t); | 671 var time_zone_string = LocalTimezoneString(t); // May update local offset. |
| 672 return DatePrintString(LocalTimeNoCheck(t)) + time_zone_string; |
672 } | 673 } |
673 | 674 |
674 | 675 |
675 // ECMA 262 - 15.9.5.3 | 676 // ECMA 262 - 15.9.5.3 |
676 function DateToDateString() { | 677 function DateToDateString() { |
677 var t = DATE_VALUE(this); | 678 var t = DATE_VALUE(this); |
678 if (NUMBER_IS_NAN(t)) return kInvalidDate; | 679 if (NUMBER_IS_NAN(t)) return kInvalidDate; |
679 return DateString(LocalTimeNoCheck(t)); | 680 return DateString(LocalTimeNoCheck(t)); |
680 } | 681 } |
681 | 682 |
682 | 683 |
683 // ECMA 262 - 15.9.5.4 | 684 // ECMA 262 - 15.9.5.4 |
684 function DateToTimeString() { | 685 function DateToTimeString() { |
685 var t = DATE_VALUE(this); | 686 var t = DATE_VALUE(this); |
686 if (NUMBER_IS_NAN(t)) return kInvalidDate; | 687 if (NUMBER_IS_NAN(t)) return kInvalidDate; |
687 var lt = LocalTimeNoCheck(t); | 688 var time_zone_string = LocalTimezoneString(t); // May update local offset. |
688 return TimeString(lt) + LocalTimezoneString(lt); | 689 return TimeString(LocalTimeNoCheck(t)) + time_zone_string; |
689 } | 690 } |
690 | 691 |
691 | 692 |
692 // ECMA 262 - 15.9.5.5 | 693 // ECMA 262 - 15.9.5.5 |
693 function DateToLocaleString() { | 694 function DateToLocaleString() { |
694 return DateToString.call(this); | 695 return DateToString.call(this); |
695 } | 696 } |
696 | 697 |
697 | 698 |
698 // ECMA 262 - 15.9.5.6 | 699 // ECMA 262 - 15.9.5.6 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 "toGMTString", DateToGMTString, | 1119 "toGMTString", DateToGMTString, |
1119 "toUTCString", DateToUTCString, | 1120 "toUTCString", DateToUTCString, |
1120 "getYear", DateGetYear, | 1121 "getYear", DateGetYear, |
1121 "setYear", DateSetYear, | 1122 "setYear", DateSetYear, |
1122 "toISOString", DateToISOString, | 1123 "toISOString", DateToISOString, |
1123 "toJSON", DateToJSON | 1124 "toJSON", DateToJSON |
1124 )); | 1125 )); |
1125 } | 1126 } |
1126 | 1127 |
1127 SetupDate(); | 1128 SetupDate(); |
OLD | NEW |