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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 ms = argc > 6 ? ToNumber(ms) : 0; | 295 ms = argc > 6 ? ToNumber(ms) : 0; |
296 year = (!NUMBER_IS_NAN(year) && | 296 year = (!NUMBER_IS_NAN(year) && |
297 0 <= TO_INTEGER(year) && | 297 0 <= TO_INTEGER(year) && |
298 TO_INTEGER(year) <= 99) ? 1900 + TO_INTEGER(year) : year; | 298 TO_INTEGER(year) <= 99) ? 1900 + TO_INTEGER(year) : year; |
299 var day = MakeDay(year, month, date); | 299 var day = MakeDay(year, month, date); |
300 var time = MakeTime(hours, minutes, seconds, ms); | 300 var time = MakeTime(hours, minutes, seconds, ms); |
301 return TimeClip(MakeDate(day, time)); | 301 return TimeClip(MakeDate(day, time)); |
302 } | 302 } |
303 | 303 |
304 | 304 |
305 // Mozilla-specific extension. Returns the number of milliseconds | 305 // ECMA 262 - 15.9.4.4 |
306 // elapsed since 1 January 1970 00:00:00 UTC. | |
307 function DateNow() { | 306 function DateNow() { |
308 return %DateCurrentTime(); | 307 return %DateCurrentTime(); |
309 } | 308 } |
310 | 309 |
311 | 310 |
312 // ECMA 262 - 15.9.5.2 | 311 // ECMA 262 - 15.9.5.2 |
313 function DateToString() { | 312 function DateToString() { |
314 var t = UTC_DATE_VALUE(this) | 313 var t = UTC_DATE_VALUE(this) |
315 if (NUMBER_IS_NAN(t)) return kInvalidDate; | 314 if (NUMBER_IS_NAN(t)) return kInvalidDate; |
316 var time_zone_string = LocalTimezoneString(this) | 315 var time_zone_string = LocalTimezoneString(this) |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 "toGMTString", DateToGMTString, | 819 "toGMTString", DateToGMTString, |
821 "toUTCString", DateToUTCString, | 820 "toUTCString", DateToUTCString, |
822 "getYear", DateGetYear, | 821 "getYear", DateGetYear, |
823 "setYear", DateSetYear, | 822 "setYear", DateSetYear, |
824 "toISOString", DateToISOString, | 823 "toISOString", DateToISOString, |
825 "toJSON", DateToJSON | 824 "toJSON", DateToJSON |
826 )); | 825 )); |
827 } | 826 } |
828 | 827 |
829 SetUpDate(); | 828 SetUpDate(); |
OLD | NEW |