Commit f6911f6b authored by ager@chromium.org's avatar ager@chromium.org

Make sure that data functions return 0 instead of -0 for a number of

date functions such as getHours for dates before 1970.

This is consistent with the behavior of other JavaScript engines.

Review URL: http://codereview.chromium.org/9770

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8bea2546
......@@ -50,6 +50,8 @@ function Day(time) {
// ECMA 262 - 5.2
function Modulo(value, remainder) {
var mod = value % remainder;
// Guard against returning -0.
if (mod == 0) return 0;
return mod >= 0 ? mod : mod + remainder;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment