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 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declarations have been made | 7 // This file relies on the fact that the following declarations have been made |
8 // in v8natives.js: | 8 // in v8natives.js: |
9 // var $isFinite = GlobalIsFinite; | 9 // var $isFinite = GlobalIsFinite; |
10 | 10 |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // Reset the timezone cache: | 740 // Reset the timezone cache: |
741 timezone_cache_time = NAN; | 741 timezone_cache_time = NAN; |
742 timezone_cache_timezone = UNDEFINED; | 742 timezone_cache_timezone = UNDEFINED; |
743 | 743 |
744 // Reset the date cache: | 744 // Reset the date cache: |
745 Date_cache.time = NAN; | 745 Date_cache.time = NAN; |
746 Date_cache.string = null; | 746 Date_cache.string = null; |
747 } | 747 } |
748 | 748 |
749 | 749 |
| 750 function CreateDate(time) { |
| 751 var date = new $Date(); |
| 752 date.setTime(time); |
| 753 return date; |
| 754 } |
| 755 |
750 // ------------------------------------------------------------------- | 756 // ------------------------------------------------------------------- |
751 | 757 |
752 function SetUpDate() { | 758 function SetUpDate() { |
753 %CheckIsBootstrapping(); | 759 %CheckIsBootstrapping(); |
754 | 760 |
755 %SetCode($Date, DateConstructor); | 761 %SetCode($Date, DateConstructor); |
756 %FunctionSetPrototype($Date, new $Date(NAN)); | 762 %FunctionSetPrototype($Date, new $Date(NAN)); |
757 | 763 |
758 // Set up non-enumerable properties of the Date object itself. | 764 // Set up non-enumerable properties of the Date object itself. |
759 InstallFunctions($Date, DONT_ENUM, $Array( | 765 InstallFunctions($Date, DONT_ENUM, $Array( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 "toGMTString", DateToGMTString, | 817 "toGMTString", DateToGMTString, |
812 "toUTCString", DateToUTCString, | 818 "toUTCString", DateToUTCString, |
813 "getYear", DateGetYear, | 819 "getYear", DateGetYear, |
814 "setYear", DateSetYear, | 820 "setYear", DateSetYear, |
815 "toISOString", DateToISOString, | 821 "toISOString", DateToISOString, |
816 "toJSON", DateToJSON | 822 "toJSON", DateToJSON |
817 )); | 823 )); |
818 } | 824 } |
819 | 825 |
820 SetUpDate(); | 826 SetUpDate(); |
OLD | NEW |