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

Side by Side Diff: src/date.js

Issue 5977006: Introduce NUMBER_IS_FINITE macro to avoid ToNumber() conversion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 ':' + PadInt(this.getUTCMinutes(), 2) + 993 ':' + PadInt(this.getUTCMinutes(), 2) +
994 ':' + PadInt(this.getUTCSeconds(), 2) + 994 ':' + PadInt(this.getUTCSeconds(), 2) +
995 '.' + PadInt(this.getUTCMilliseconds(), 3) + 995 '.' + PadInt(this.getUTCMilliseconds(), 3) +
996 'Z'; 996 'Z';
997 } 997 }
998 998
999 999
1000 function DateToJSON(key) { 1000 function DateToJSON(key) {
1001 var o = ToObject(this); 1001 var o = ToObject(this);
1002 var tv = DefaultNumber(o); 1002 var tv = DefaultNumber(o);
1003 if (IS_NUMBER(tv) && !$isFinite(tv)) { 1003 if (IS_NUMBER(tv) && !NUMBER_IS_FINITE(tv)) {
1004 return null; 1004 return null;
1005 } 1005 }
1006 return o.toISOString(); 1006 return o.toISOString();
1007 } 1007 }
1008 1008
1009 1009
1010 function ResetDateCache() { 1010 function ResetDateCache() {
1011 1011
1012 // Reset the local_time_offset: 1012 // Reset the local_time_offset:
1013 local_time_offset = %DateLocalTimeOffset(); 1013 local_time_offset = %DateLocalTimeOffset();
(...skipping 85 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