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 // This file relies on the fact that the following declarations have been made | 5 // This file relies on the fact that the following declarations have been made |
6 // in v8natives.js: | 6 // in v8natives.js: |
7 // var $isFinite = GlobalIsFinite; | 7 // var $isFinite = GlobalIsFinite; |
8 | 8 |
9 var $createDate; | 9 var $createDate; |
10 | 10 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 | 12 |
13 (function() { | 13 (function() { |
14 | 14 |
15 "use strict"; | 15 "use strict"; |
16 | 16 |
17 %CheckIsBootstrapping(); | 17 %CheckIsBootstrapping(); |
18 | 18 |
19 var GlobalDate = global.Date; | 19 var GlobalDate = global.Date; |
20 | 20 |
21 // This file contains date support implemented in JavaScript. | 21 // This file contains date support implemented in JavaScript. |
22 | 22 |
23 // Helper function to throw error. | |
24 function ThrowDateTypeError() { | |
25 throw new $TypeError('this is not a Date object.'); | |
26 } | |
27 | |
28 var timezone_cache_time = NAN; | 23 var timezone_cache_time = NAN; |
29 var timezone_cache_timezone; | 24 var timezone_cache_timezone; |
30 | 25 |
31 function LocalTimezone(t) { | 26 function LocalTimezone(t) { |
32 if (NUMBER_IS_NAN(t)) return ""; | 27 if (NUMBER_IS_NAN(t)) return ""; |
33 CheckDateCacheCurrent(); | 28 CheckDateCacheCurrent(); |
34 if (t == timezone_cache_time) { | 29 if (t == timezone_cache_time) { |
35 return timezone_cache_timezone; | 30 return timezone_cache_timezone; |
36 } | 31 } |
37 var timezone = %DateLocalTimezone(t); | 32 var timezone = %DateLocalTimezone(t); |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 "getYear", DateGetYear, | 817 "getYear", DateGetYear, |
823 "setYear", DateSetYear, | 818 "setYear", DateSetYear, |
824 "toISOString", DateToISOString, | 819 "toISOString", DateToISOString, |
825 "toJSON", DateToJSON | 820 "toJSON", DateToJSON |
826 ]); | 821 ]); |
827 | 822 |
828 // Expose to the global scope. | 823 // Expose to the global scope. |
829 $createDate = CreateDate; | 824 $createDate = CreateDate; |
830 | 825 |
831 })(); | 826 })(); |
OLD | NEW |