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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 | 240 |
241 function LocalTime(time) { | 241 function LocalTime(time) { |
242 if (NUMBER_IS_NAN(time)) return time; | 242 if (NUMBER_IS_NAN(time)) return time; |
243 // DaylightSavingsOffset called before local_time_offset used. | 243 // DaylightSavingsOffset called before local_time_offset used. |
244 return time + DaylightSavingsOffset(time) + local_time_offset; | 244 return time + DaylightSavingsOffset(time) + local_time_offset; |
245 } | 245 } |
246 | 246 |
247 | 247 |
248 var ltcache = { | 248 var ltcache = { |
249 key: null, | 249 key: null, |
250 val: null | 250 val: null |
251 }; | 251 }; |
252 | 252 |
253 function LocalTimeNoCheck(time) { | 253 function LocalTimeNoCheck(time) { |
254 var ltc = ltcache; | 254 var ltc = ltcache; |
255 if (%_ObjectEquals(time, ltc.key)) return ltc.val; | 255 if (%_ObjectEquals(time, ltc.key)) return ltc.val; |
256 if (time < -MAX_TIME_MS || time > MAX_TIME_MS) { | 256 if (time < -MAX_TIME_MS || time > MAX_TIME_MS) { |
257 return $NaN; | 257 return $NaN; |
258 } | 258 } |
259 | 259 |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 "toGMTString", DateToGMTString, | 1056 "toGMTString", DateToGMTString, |
1057 "toUTCString", DateToUTCString, | 1057 "toUTCString", DateToUTCString, |
1058 "getYear", DateGetYear, | 1058 "getYear", DateGetYear, |
1059 "setYear", DateSetYear, | 1059 "setYear", DateSetYear, |
1060 "toISOString", DateToISOString, | 1060 "toISOString", DateToISOString, |
1061 "toJSON", DateToJSON | 1061 "toJSON", DateToJSON |
1062 )); | 1062 )); |
1063 } | 1063 } |
1064 | 1064 |
1065 SetupDate(); | 1065 SetupDate(); |
OLD | NEW |