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

Side by Side Diff: src/date-delay.js

Issue 9770: Make sure that data functions return 0 instead of -0 for a number of... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 | no next file » | 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // ECMA 262 - 15.9.1.2 44 // ECMA 262 - 15.9.1.2
45 function Day(time) { 45 function Day(time) {
46 return FLOOR(time/msPerDay); 46 return FLOOR(time/msPerDay);
47 } 47 }
48 48
49 49
50 // ECMA 262 - 5.2 50 // ECMA 262 - 5.2
51 function Modulo(value, remainder) { 51 function Modulo(value, remainder) {
52 var mod = value % remainder; 52 var mod = value % remainder;
53 // Guard against returning -0.
54 if (mod == 0) return 0;
53 return mod >= 0 ? mod : mod + remainder; 55 return mod >= 0 ? mod : mod + remainder;
54 } 56 }
55 57
56 58
57 function TimeWithinDay(time) { 59 function TimeWithinDay(time) {
58 return Modulo(time, msPerDay); 60 return Modulo(time, msPerDay);
59 } 61 }
60 62
61 63
62 // ECMA 262 - 15.9.1.3 64 // ECMA 262 - 15.9.1.3
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 "setFullYear", DateSetFullYear, 1028 "setFullYear", DateSetFullYear,
1027 "setUTCFullYear", DateSetUTCFullYear, 1029 "setUTCFullYear", DateSetUTCFullYear,
1028 "toGMTString", DateToGMTString, 1030 "toGMTString", DateToGMTString,
1029 "toUTCString", DateToUTCString, 1031 "toUTCString", DateToUTCString,
1030 "getYear", DateGetYear, 1032 "getYear", DateGetYear,
1031 "setYear", DateSetYear 1033 "setYear", DateSetYear
1032 )); 1034 ));
1033 } 1035 }
1034 1036
1035 SetupDate(); 1037 SetupDate();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698