Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: src/date.js

Issue 6349018: Avoid using Function.prototype.call in a number of places in our (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/json.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 function DateToTimeString() { 598 function DateToTimeString() {
599 var t = DATE_VALUE(this); 599 var t = DATE_VALUE(this);
600 if (NUMBER_IS_NAN(t)) return kInvalidDate; 600 if (NUMBER_IS_NAN(t)) return kInvalidDate;
601 var time_zone_string = LocalTimezoneString(t); // May update local offset. 601 var time_zone_string = LocalTimezoneString(t); // May update local offset.
602 return TimeString(LocalTimeNoCheck(t)) + time_zone_string; 602 return TimeString(LocalTimeNoCheck(t)) + time_zone_string;
603 } 603 }
604 604
605 605
606 // ECMA 262 - 15.9.5.5 606 // ECMA 262 - 15.9.5.5
607 function DateToLocaleString() { 607 function DateToLocaleString() {
608 return DateToString.call(this); 608 return %_CallFunction(this, DateToString);
609 } 609 }
610 610
611 611
612 // ECMA 262 - 15.9.5.6 612 // ECMA 262 - 15.9.5.6
613 function DateToLocaleDateString() { 613 function DateToLocaleDateString() {
614 var t = DATE_VALUE(this); 614 var t = DATE_VALUE(this);
615 if (NUMBER_IS_NAN(t)) return kInvalidDate; 615 if (NUMBER_IS_NAN(t)) return kInvalidDate;
616 return LongDateString(LocalTimeNoCheck(t)); 616 return LongDateString(LocalTimeNoCheck(t));
617 } 617 }
618 618
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 966
967 967
968 // ECMA 262 - B.2.6 968 // ECMA 262 - B.2.6
969 // 969 //
970 // Notice that this does not follow ECMA 262 completely. ECMA 262 970 // Notice that this does not follow ECMA 262 completely. ECMA 262
971 // says that toGMTString should be the same Function object as 971 // says that toGMTString should be the same Function object as
972 // toUTCString. JSC does not do this, so for compatibility we do not 972 // toUTCString. JSC does not do this, so for compatibility we do not
973 // do that either. Instead, we create a new function whose name 973 // do that either. Instead, we create a new function whose name
974 // property will return toGMTString. 974 // property will return toGMTString.
975 function DateToGMTString() { 975 function DateToGMTString() {
976 return DateToUTCString.call(this); 976 return %_CallFunction(this, DateToUTCString);
977 } 977 }
978 978
979 979
980 function PadInt(n, digits) { 980 function PadInt(n, digits) {
981 if (digits == 1) return n; 981 if (digits == 1) return n;
982 return n < MathPow(10, digits - 1) ? '0' + PadInt(n, digits - 1) : n; 982 return n < MathPow(10, digits - 1) ? '0' + PadInt(n, digits - 1) : n;
983 } 983 }
984 984
985 985
986 function DateToISOString() { 986 function DateToISOString() {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 "toGMTString", DateToGMTString, 1099 "toGMTString", DateToGMTString,
1100 "toUTCString", DateToUTCString, 1100 "toUTCString", DateToUTCString,
1101 "getYear", DateGetYear, 1101 "getYear", DateGetYear,
1102 "setYear", DateSetYear, 1102 "setYear", DateSetYear,
1103 "toISOString", DateToISOString, 1103 "toISOString", DateToISOString,
1104 "toJSON", DateToJSON 1104 "toJSON", DateToJSON
1105 )); 1105 ));
1106 } 1106 }
1107 1107
1108 SetupDate(); 1108 SetupDate();
OLDNEW
« no previous file with comments | « no previous file | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698