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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 // ECMA 262 - 15.9.1.14 | 418 // ECMA 262 - 15.9.1.14 |
419 function TimeClip(time) { | 419 function TimeClip(time) { |
420 if (!$isFinite(time)) return $NaN; | 420 if (!$isFinite(time)) return $NaN; |
421 if ($abs(time) > 8.64E15) return $NaN; | 421 if ($abs(time) > 8.64E15) return $NaN; |
422 return TO_INTEGER(time); | 422 return TO_INTEGER(time); |
423 } | 423 } |
424 | 424 |
425 | 425 |
426 %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) { | 426 %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) { |
427 if (%IsConstructCall()) { | 427 if (%_IsConstructCall()) { |
428 // ECMA 262 - 15.9.3 | 428 // ECMA 262 - 15.9.3 |
429 var argc = %_ArgumentsLength(); | 429 var argc = %_ArgumentsLength(); |
430 if (argc == 0) { | 430 if (argc == 0) { |
431 %_SetValueOf(this, %DateCurrentTime()); | 431 %_SetValueOf(this, %DateCurrentTime()); |
432 return; | 432 return; |
433 } | 433 } |
434 if (argc == 1) { | 434 if (argc == 1) { |
435 // According to ECMA 262, no hint should be given for this | 435 // According to ECMA 262, no hint should be given for this |
436 // conversion. However, ToPrimitive defaults to String Hint | 436 // conversion. However, ToPrimitive defaults to String Hint |
437 // for Date objects which will lose precision when the Date | 437 // for Date objects which will lose precision when the Date |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 "toGMTString", DateToGMTString, | 1125 "toGMTString", DateToGMTString, |
1126 "toUTCString", DateToUTCString, | 1126 "toUTCString", DateToUTCString, |
1127 "getYear", DateGetYear, | 1127 "getYear", DateGetYear, |
1128 "setYear", DateSetYear, | 1128 "setYear", DateSetYear, |
1129 "toISOString", DateToISOString, | 1129 "toISOString", DateToISOString, |
1130 "toJSON", DateToJSON | 1130 "toJSON", DateToJSON |
1131 )); | 1131 )); |
1132 } | 1132 } |
1133 | 1133 |
1134 SetupDate(); | 1134 SetupDate(); |
OLD | NEW |