| 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 var $createDate; | 5 var $createDate; |
| 6 | 6 |
| 7 // ------------------------------------------------------------------- | 7 // ------------------------------------------------------------------- |
| 8 | 8 |
| 9 (function(global, utils) { | 9 (function(global, utils) { |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Cached time value. | 126 // Cached time value. |
| 127 time: 0, | 127 time: 0, |
| 128 // String input for which the cached time is valid. | 128 // String input for which the cached time is valid. |
| 129 string: null | 129 string: null |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 | 132 |
| 133 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { | 133 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { |
| 134 if (!%_IsConstructCall()) { | 134 if (!%_IsConstructCall()) { |
| 135 // ECMA 262 - 15.9.2 | 135 // ECMA 262 - 15.9.2 |
| 136 return (new GlobalDate()).toString(); | 136 return %_CallFunction(new GlobalDate(), DateToString); |
| 137 } | 137 } |
| 138 | 138 |
| 139 // ECMA 262 - 15.9.3 | 139 // ECMA 262 - 15.9.3 |
| 140 var argc = %_ArgumentsLength(); | 140 var argc = %_ArgumentsLength(); |
| 141 var value; | 141 var value; |
| 142 if (argc == 0) { | 142 if (argc == 0) { |
| 143 value = %DateCurrentTime(); | 143 value = %DateCurrentTime(); |
| 144 SET_UTC_DATE_VALUE(this, value); | 144 SET_UTC_DATE_VALUE(this, value); |
| 145 } else if (argc == 1) { | 145 } else if (argc == 1) { |
| 146 if (IS_NUMBER(year)) { | 146 if (IS_NUMBER(year)) { |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 "getYear", DateGetYear, | 877 "getYear", DateGetYear, |
| 878 "setYear", DateSetYear, | 878 "setYear", DateSetYear, |
| 879 "toISOString", DateToISOString, | 879 "toISOString", DateToISOString, |
| 880 "toJSON", DateToJSON | 880 "toJSON", DateToJSON |
| 881 ]); | 881 ]); |
| 882 | 882 |
| 883 // Expose to the global scope. | 883 // Expose to the global scope. |
| 884 $createDate = CreateDate; | 884 $createDate = CreateDate; |
| 885 | 885 |
| 886 }) | 886 }) |
| OLD | NEW |