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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 // Reset the date cache: | 1041 // Reset the date cache: |
1042 cache = Date_cache; | 1042 cache = Date_cache; |
1043 cache.time = $NaN; | 1043 cache.time = $NaN; |
1044 cache.year = $NaN; | 1044 cache.year = $NaN; |
1045 cache.string = null; | 1045 cache.string = null; |
1046 } | 1046 } |
1047 | 1047 |
1048 | 1048 |
1049 // ------------------------------------------------------------------- | 1049 // ------------------------------------------------------------------- |
1050 | 1050 |
1051 function SetupDate() { | 1051 function SetUpDate() { |
1052 // Setup non-enumerable properties of the Date object itself. | 1052 %CheckIsBootstrapping(); |
| 1053 // Set up non-enumerable properties of the Date object itself. |
1053 InstallFunctions($Date, DONT_ENUM, $Array( | 1054 InstallFunctions($Date, DONT_ENUM, $Array( |
1054 "UTC", DateUTC, | 1055 "UTC", DateUTC, |
1055 "parse", DateParse, | 1056 "parse", DateParse, |
1056 "now", DateNow | 1057 "now", DateNow |
1057 )); | 1058 )); |
1058 | 1059 |
1059 // Setup non-enumerable constructor property of the Date prototype object. | 1060 // Set up non-enumerable constructor property of the Date prototype object. |
1060 %SetProperty($Date.prototype, "constructor", $Date, DONT_ENUM); | 1061 %SetProperty($Date.prototype, "constructor", $Date, DONT_ENUM); |
1061 | 1062 |
1062 // Setup non-enumerable functions of the Date prototype object and | 1063 // Set up non-enumerable functions of the Date prototype object and |
1063 // set their names. | 1064 // set their names. |
1064 InstallFunctionsOnHiddenPrototype($Date.prototype, DONT_ENUM, $Array( | 1065 InstallFunctionsOnHiddenPrototype($Date.prototype, DONT_ENUM, $Array( |
1065 "toString", DateToString, | 1066 "toString", DateToString, |
1066 "toDateString", DateToDateString, | 1067 "toDateString", DateToDateString, |
1067 "toTimeString", DateToTimeString, | 1068 "toTimeString", DateToTimeString, |
1068 "toLocaleString", DateToLocaleString, | 1069 "toLocaleString", DateToLocaleString, |
1069 "toLocaleDateString", DateToLocaleDateString, | 1070 "toLocaleDateString", DateToLocaleDateString, |
1070 "toLocaleTimeString", DateToLocaleTimeString, | 1071 "toLocaleTimeString", DateToLocaleTimeString, |
1071 "valueOf", DateValueOf, | 1072 "valueOf", DateValueOf, |
1072 "getTime", DateGetTime, | 1073 "getTime", DateGetTime, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 "setUTCFullYear", DateSetUTCFullYear, | 1105 "setUTCFullYear", DateSetUTCFullYear, |
1105 "toGMTString", DateToGMTString, | 1106 "toGMTString", DateToGMTString, |
1106 "toUTCString", DateToUTCString, | 1107 "toUTCString", DateToUTCString, |
1107 "getYear", DateGetYear, | 1108 "getYear", DateGetYear, |
1108 "setYear", DateSetYear, | 1109 "setYear", DateSetYear, |
1109 "toISOString", DateToISOString, | 1110 "toISOString", DateToISOString, |
1110 "toJSON", DateToJSON | 1111 "toJSON", DateToJSON |
1111 )); | 1112 )); |
1112 } | 1113 } |
1113 | 1114 |
1114 SetupDate(); | 1115 SetUpDate(); |
OLD | NEW |