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 |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 date.setTime(time); | 753 date.setTime(time); |
754 return date; | 754 return date; |
755 } | 755 } |
756 | 756 |
757 // ------------------------------------------------------------------- | 757 // ------------------------------------------------------------------- |
758 | 758 |
759 %SetCode(GlobalDate, DateConstructor); | 759 %SetCode(GlobalDate, DateConstructor); |
760 %FunctionSetPrototype(GlobalDate, new GlobalDate(NAN)); | 760 %FunctionSetPrototype(GlobalDate, new GlobalDate(NAN)); |
761 | 761 |
762 // Set up non-enumerable properties of the Date object itself. | 762 // Set up non-enumerable properties of the Date object itself. |
763 $installFunctions(GlobalDate, DONT_ENUM, [ | 763 InstallFunctions(GlobalDate, DONT_ENUM, [ |
764 "UTC", DateUTC, | 764 "UTC", DateUTC, |
765 "parse", DateParse, | 765 "parse", DateParse, |
766 "now", DateNow | 766 "now", DateNow |
767 ]); | 767 ]); |
768 | 768 |
769 // Set up non-enumerable constructor property of the Date prototype object. | 769 // Set up non-enumerable constructor property of the Date prototype object. |
770 %AddNamedProperty(GlobalDate.prototype, "constructor", GlobalDate, DONT_ENUM); | 770 %AddNamedProperty(GlobalDate.prototype, "constructor", GlobalDate, DONT_ENUM); |
771 | 771 |
772 // Set up non-enumerable functions of the Date prototype object and | 772 // Set up non-enumerable functions of the Date prototype object and |
773 // set their names. | 773 // set their names. |
774 $installFunctions(GlobalDate.prototype, DONT_ENUM, [ | 774 InstallFunctions(GlobalDate.prototype, DONT_ENUM, [ |
775 "toString", DateToString, | 775 "toString", DateToString, |
776 "toDateString", DateToDateString, | 776 "toDateString", DateToDateString, |
777 "toTimeString", DateToTimeString, | 777 "toTimeString", DateToTimeString, |
778 "toLocaleString", DateToLocaleString, | 778 "toLocaleString", DateToLocaleString, |
779 "toLocaleDateString", DateToLocaleDateString, | 779 "toLocaleDateString", DateToLocaleDateString, |
780 "toLocaleTimeString", DateToLocaleTimeString, | 780 "toLocaleTimeString", DateToLocaleTimeString, |
781 "valueOf", DateValueOf, | 781 "valueOf", DateValueOf, |
782 "getTime", DateGetTime, | 782 "getTime", DateGetTime, |
783 "getFullYear", DateGetFullYear, | 783 "getFullYear", DateGetFullYear, |
784 "getUTCFullYear", DateGetUTCFullYear, | 784 "getUTCFullYear", DateGetUTCFullYear, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 "getYear", DateGetYear, | 817 "getYear", DateGetYear, |
818 "setYear", DateSetYear, | 818 "setYear", DateSetYear, |
819 "toISOString", DateToISOString, | 819 "toISOString", DateToISOString, |
820 "toJSON", DateToJSON | 820 "toJSON", DateToJSON |
821 ]); | 821 ]); |
822 | 822 |
823 // Expose to the global scope. | 823 // Expose to the global scope. |
824 $createDate = CreateDate; | 824 $createDate = CreateDate; |
825 | 825 |
826 })(); | 826 })(); |
OLD | NEW |