Bug 1074911 - Replace JS_ASSERT by MOZ_ASSERT. r=jorendorff
Apply the following script
sed -i '
/JS_ASSERT(/ {
s/JS_ASSERT(/MOZ_ASSERT(/;
:b;
s/ \\$/\\/;
/;/ { p; d; };
n;
s/^/ /;
b b;
};
s/JS_ASSERT (/MOZ_ASSERT(/;
'
Except where the JS_ASSERT macro does not end with a semi-colon, where empty
lines are in the middle of the macro, and where the backslahes are always the
same-length after the expression.
This commit is contained in:
@@ -122,7 +122,7 @@ TimeWithinDay(double t)
|
||||
static inline bool
|
||||
IsLeapYear(double year)
|
||||
{
|
||||
JS_ASSERT(ToInteger(year) == year);
|
||||
MOZ_ASSERT(ToInteger(year) == year);
|
||||
return fmod(year, 4) == 0 && (fmod(year, 100) != 0 || fmod(year, 400) == 0);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ YearFromTime(double t)
|
||||
if (!IsFinite(t))
|
||||
return GenericNaN();
|
||||
|
||||
JS_ASSERT(ToInteger(t) == t);
|
||||
MOZ_ASSERT(ToInteger(t) == t);
|
||||
|
||||
double y = floor(t / (msPerDay * 365.2425)) + 1970;
|
||||
double t2 = TimeFromYear(y);
|
||||
@@ -278,7 +278,7 @@ WeekDay(double t)
|
||||
* We can't assert TimeClip(t) == t because we call this function with
|
||||
* local times, which can be offset outside TimeClip's permitted range.
|
||||
*/
|
||||
JS_ASSERT(ToInteger(t) == t);
|
||||
MOZ_ASSERT(ToInteger(t) == t);
|
||||
int result = (int(Day(t)) + 4) % 7;
|
||||
if (result < 0)
|
||||
result += 7;
|
||||
@@ -297,7 +297,7 @@ DayFromMonth(int month, bool isLeapYear)
|
||||
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
|
||||
};
|
||||
|
||||
JS_ASSERT(0 <= month && month <= 12);
|
||||
MOZ_ASSERT(0 <= month && month <= 12);
|
||||
return firstDayOfMonth[isLeapYear][month];
|
||||
}
|
||||
|
||||
@@ -518,8 +518,8 @@ MakeTime(double hour, double min, double sec, double ms)
|
||||
static bool
|
||||
date_convert(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp)
|
||||
{
|
||||
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
|
||||
JS_ASSERT(obj->is<DateObject>());
|
||||
MOZ_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
|
||||
MOZ_ASSERT(obj->is<DateObject>());
|
||||
|
||||
return DefaultValue(cx, obj, (hint == JSTYPE_VOID) ? JSTYPE_STRING : hint, vp);
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ ParseDate(const CharT *s, size_t length, double *result, DateTimeInfo *dtInfo)
|
||||
* AM/PM. Count 12:30 AM as 00:30, 12:30 PM as
|
||||
* 12:30, instead of blindly adding 12 if PM.
|
||||
*/
|
||||
JS_ASSERT(action == -1 || action == -2);
|
||||
MOZ_ASSERT(action == -1 || action == -2);
|
||||
if (hour > 12 || hour < 0)
|
||||
return false;
|
||||
|
||||
@@ -2358,7 +2358,7 @@ static const char * const months[] =
|
||||
static void
|
||||
print_gmt_string(char* buf, size_t size, double utctime)
|
||||
{
|
||||
JS_ASSERT(TimeClip(utctime) == utctime);
|
||||
MOZ_ASSERT(TimeClip(utctime) == utctime);
|
||||
JS_snprintf(buf, size, "%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT",
|
||||
days[int(WeekDay(utctime))],
|
||||
int(DateFromTime(utctime)),
|
||||
@@ -2372,7 +2372,7 @@ print_gmt_string(char* buf, size_t size, double utctime)
|
||||
static void
|
||||
print_iso_string(char* buf, size_t size, double utctime)
|
||||
{
|
||||
JS_ASSERT(TimeClip(utctime) == utctime);
|
||||
MOZ_ASSERT(TimeClip(utctime) == utctime);
|
||||
JS_snprintf(buf, size, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.%.3dZ",
|
||||
int(YearFromTime(utctime)),
|
||||
int(MonthFromTime(utctime)) + 1,
|
||||
@@ -2524,7 +2524,7 @@ date_format(JSContext *cx, double date, formatspec format, MutableHandleValue rv
|
||||
if (!IsFinite(date)) {
|
||||
JS_snprintf(buf, sizeof buf, js_NaN_date_str);
|
||||
} else {
|
||||
JS_ASSERT(TimeClip(date) == date);
|
||||
MOZ_ASSERT(TimeClip(date) == date);
|
||||
|
||||
double local = LocalTime(date, &cx->runtime()->dateTimeInfo);
|
||||
|
||||
@@ -3054,7 +3054,7 @@ JS_FRIEND_API(JSObject *)
|
||||
js_NewDateObject(JSContext *cx, int year, int mon, int mday,
|
||||
int hour, int min, int sec)
|
||||
{
|
||||
JS_ASSERT(mon < 12);
|
||||
MOZ_ASSERT(mon < 12);
|
||||
double msec_time = date_msecFromDate(year, mon, mday, hour, min, sec, 0);
|
||||
return js_NewDateObjectMsec(cx, UTC(msec_time, &cx->runtime()->dateTimeInfo));
|
||||
}
|
||||
@@ -3069,7 +3069,7 @@ JS_FRIEND_API(int)
|
||||
js_DateGetYear(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
/* Preserve legacy API behavior of returning 0 for invalid dates. */
|
||||
JS_ASSERT(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
double localtime = obj->as<DateObject>().cachedLocalTime(&cx->runtime()->dateTimeInfo);
|
||||
if (IsNaN(localtime))
|
||||
return 0;
|
||||
@@ -3080,7 +3080,7 @@ js_DateGetYear(JSContext *cx, JSObject *obj)
|
||||
JS_FRIEND_API(int)
|
||||
js_DateGetMonth(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JS_ASSERT(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
double localtime = obj->as<DateObject>().cachedLocalTime(&cx->runtime()->dateTimeInfo);
|
||||
if (IsNaN(localtime))
|
||||
return 0;
|
||||
@@ -3091,7 +3091,7 @@ js_DateGetMonth(JSContext *cx, JSObject *obj)
|
||||
JS_FRIEND_API(int)
|
||||
js_DateGetDate(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JS_ASSERT(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
double localtime = obj->as<DateObject>().cachedLocalTime(&cx->runtime()->dateTimeInfo);
|
||||
if (IsNaN(localtime))
|
||||
return 0;
|
||||
@@ -3102,7 +3102,7 @@ js_DateGetDate(JSContext *cx, JSObject *obj)
|
||||
JS_FRIEND_API(int)
|
||||
js_DateGetHours(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JS_ASSERT(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
double localtime = obj->as<DateObject>().cachedLocalTime(&cx->runtime()->dateTimeInfo);
|
||||
if (IsNaN(localtime))
|
||||
return 0;
|
||||
@@ -3113,7 +3113,7 @@ js_DateGetHours(JSContext *cx, JSObject *obj)
|
||||
JS_FRIEND_API(int)
|
||||
js_DateGetMinutes(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JS_ASSERT(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
double localtime = obj->as<DateObject>().cachedLocalTime(&cx->runtime()->dateTimeInfo);
|
||||
if (IsNaN(localtime))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user