Backout afab1aaf6704 & 0405d42629fd (bug 747197), 0379525bbdca (bug 746262), 91b9cba098f8 (bug 745944), 8535dc5b590a (bug 741040) for win debug bustage
This commit is contained in:
@@ -75,7 +75,6 @@
|
||||
#include "jslibmath.h"
|
||||
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/NumericConversions.h"
|
||||
#include "vm/StringBuffer.h"
|
||||
|
||||
#include "jsinferinlines.h"
|
||||
@@ -615,7 +614,7 @@ date_msecFromArgs(JSContext *cx, CallArgs args, double *rval)
|
||||
*rval = js_NaN;
|
||||
return JS_TRUE;
|
||||
}
|
||||
array[loop] = ToInteger(d);
|
||||
array[loop] = js_DoubleToInteger(d);
|
||||
} else {
|
||||
if (loop == 2) {
|
||||
array[loop] = 1; /* Default the date argument to 1. */
|
||||
@@ -647,7 +646,7 @@ date_UTC(JSContext *cx, unsigned argc, Value *vp)
|
||||
if (!date_msecFromArgs(cx, args, &msec_time))
|
||||
return JS_FALSE;
|
||||
|
||||
msec_time = TimeClip(msec_time);
|
||||
msec_time = TIMECLIP(msec_time);
|
||||
|
||||
args.rval().setNumber(msec_time);
|
||||
return JS_TRUE;
|
||||
@@ -1206,7 +1205,7 @@ date_parse(JSContext *cx, unsigned argc, Value *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
result = TimeClip(result);
|
||||
result = TIMECLIP(result);
|
||||
vp->setNumber(result);
|
||||
return true;
|
||||
}
|
||||
@@ -1747,7 +1746,7 @@ date_setTime(JSContext *cx, unsigned argc, Value *vp)
|
||||
if (!ToNumber(cx, args[0], &result))
|
||||
return false;
|
||||
|
||||
return SetUTCTime(cx, obj, TimeClip(result), &args.rval());
|
||||
return SetUTCTime(cx, obj, TIMECLIP(result), &args.rval());
|
||||
}
|
||||
|
||||
static JSBool
|
||||
@@ -1786,7 +1785,7 @@ date_makeTime(JSContext *cx, Native native, unsigned maxargs, JSBool local, unsi
|
||||
if (!MOZ_DOUBLE_IS_FINITE(nums[i])) {
|
||||
argIsNotFinite = true;
|
||||
} else {
|
||||
nums[i] = ToInteger(nums[i]);
|
||||
nums[i] = js_DoubleToInteger(nums[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1843,7 +1842,7 @@ date_makeTime(JSContext *cx, Native native, unsigned maxargs, JSBool local, unsi
|
||||
if (local)
|
||||
result = UTC(result, cx);
|
||||
|
||||
return SetUTCTime(cx, obj, TimeClip(result), &args.rval());
|
||||
return SetUTCTime(cx, obj, TIMECLIP(result), &args.rval());
|
||||
}
|
||||
|
||||
static JSBool
|
||||
@@ -1922,7 +1921,7 @@ date_makeDate(JSContext *cx, Native native, unsigned maxargs, JSBool local, unsi
|
||||
if (!MOZ_DOUBLE_IS_FINITE(nums[i])) {
|
||||
argIsNotFinite = true;
|
||||
} else {
|
||||
nums[i] = ToInteger(nums[i]);
|
||||
nums[i] = js_DoubleToInteger(nums[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1973,7 +1972,7 @@ date_makeDate(JSContext *cx, Native native, unsigned maxargs, JSBool local, unsi
|
||||
if (local)
|
||||
result = UTC(result, cx);
|
||||
|
||||
return SetUTCTime(cx, obj, TimeClip(result), &args.rval());
|
||||
return SetUTCTime(cx, obj, TIMECLIP(result), &args.rval());
|
||||
}
|
||||
|
||||
static JSBool
|
||||
@@ -2037,7 +2036,7 @@ date_setYear(JSContext *cx, unsigned argc, Value *vp)
|
||||
SetDateToNaN(cx, obj, &args.rval());
|
||||
return true;
|
||||
}
|
||||
year = ToInteger(year);
|
||||
year = js_DoubleToInteger(year);
|
||||
if (year >= 0 && year <= 99)
|
||||
year += 1900;
|
||||
|
||||
@@ -2046,7 +2045,7 @@ date_setYear(JSContext *cx, unsigned argc, Value *vp)
|
||||
result = MakeDate(day, TimeWithinDay(t));
|
||||
result = UTC(result, cx);
|
||||
|
||||
return SetUTCTime(cx, obj, TimeClip(result), &args.rval());
|
||||
return SetUTCTime(cx, obj, TIMECLIP(result), &args.rval());
|
||||
}
|
||||
|
||||
/* constants for toString, toUTCString */
|
||||
@@ -2623,7 +2622,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
|
||||
/* the argument is a millisecond number */
|
||||
if (!ToNumber(cx, args[0], &d))
|
||||
return false;
|
||||
d = TimeClip(d);
|
||||
d = TIMECLIP(d);
|
||||
} else {
|
||||
/* the argument is a string; parse it. */
|
||||
JSString *str = ToString(cx, args[0]);
|
||||
@@ -2637,7 +2636,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
|
||||
if (!date_parseString(linearStr, &d, cx))
|
||||
d = js_NaN;
|
||||
else
|
||||
d = TimeClip(d);
|
||||
d = TIMECLIP(d);
|
||||
}
|
||||
} else {
|
||||
double msec_time;
|
||||
@@ -2646,7 +2645,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
|
||||
|
||||
if (MOZ_DOUBLE_IS_FINITE(msec_time)) {
|
||||
msec_time = UTC(msec_time, cx);
|
||||
msec_time = TimeClip(msec_time);
|
||||
msec_time = TIMECLIP(msec_time);
|
||||
}
|
||||
d = msec_time;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user