| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (!$isFinite(time)) return NAN; | 125 if (!$isFinite(time)) return NAN; |
| 126 if ($abs(time) > MAX_TIME_MS) return NAN; | 126 if ($abs(time) > MAX_TIME_MS) return NAN; |
| 127 return TO_INTEGER(time); | 127 return TO_INTEGER(time); |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 // The Date cache is used to limit the cost of parsing the same Date | 131 // The Date cache is used to limit the cost of parsing the same Date |
| 132 // strings over and over again. | 132 // strings over and over again. |
| 133 var Date_cache = { | 133 var Date_cache = { |
| 134 // Cached time value. | 134 // Cached time value. |
| 135 time: NAN, | 135 time: 0, |
| 136 // String input for which the cached time is valid. | 136 // String input for which the cached time is valid. |
| 137 string: null | 137 string: null |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 | 140 |
| 141 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { | 141 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { |
| 142 if (!%_IsConstructCall()) { | 142 if (!%_IsConstructCall()) { |
| 143 // ECMA 262 - 15.9.2 | 143 // ECMA 262 - 15.9.2 |
| 144 return (new $Date()).toString(); | 144 return (new $Date()).toString(); |
| 145 } | 145 } |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 "toGMTString", DateToGMTString, | 819 "toGMTString", DateToGMTString, |
| 820 "toUTCString", DateToUTCString, | 820 "toUTCString", DateToUTCString, |
| 821 "getYear", DateGetYear, | 821 "getYear", DateGetYear, |
| 822 "setYear", DateSetYear, | 822 "setYear", DateSetYear, |
| 823 "toISOString", DateToISOString, | 823 "toISOString", DateToISOString, |
| 824 "toJSON", DateToJSON | 824 "toJSON", DateToJSON |
| 825 )); | 825 )); |
| 826 } | 826 } |
| 827 | 827 |
| 828 SetUpDate(); | 828 SetUpDate(); |
| OLD | NEW |