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:
@@ -33,19 +33,19 @@ WeakMapBase::WeakMapBase(JSObject *memOf, JSCompartment *c)
|
||||
|
||||
WeakMapBase::~WeakMapBase()
|
||||
{
|
||||
JS_ASSERT(!isInList());
|
||||
MOZ_ASSERT(!isInList());
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::trace(JSTracer *tracer)
|
||||
{
|
||||
JS_ASSERT(isInList());
|
||||
MOZ_ASSERT(isInList());
|
||||
if (IS_GC_MARKING_TRACER(tracer)) {
|
||||
// We don't trace any of the WeakMap entries at this time, just record
|
||||
// record the fact that the WeakMap has been marked. Enties are marked
|
||||
// in the iterative marking phase by markAllIteratively(), which happens
|
||||
// when many keys as possible have been marked already.
|
||||
JS_ASSERT(tracer->eagerlyTraceWeakMaps() == DoNotTraceWeakMaps);
|
||||
MOZ_ASSERT(tracer->eagerlyTraceWeakMaps() == DoNotTraceWeakMaps);
|
||||
marked = true;
|
||||
} else {
|
||||
// If we're not actually doing garbage collection, the keys won't be marked
|
||||
@@ -71,7 +71,7 @@ WeakMapBase::unmarkCompartment(JSCompartment *c)
|
||||
void
|
||||
WeakMapBase::markAll(JSCompartment *c, JSTracer *tracer)
|
||||
{
|
||||
JS_ASSERT(tracer->eagerlyTraceWeakMaps() != DoNotTraceWeakMaps);
|
||||
MOZ_ASSERT(tracer->eagerlyTraceWeakMaps() != DoNotTraceWeakMaps);
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
m->trace(tracer);
|
||||
if (m->memberOf)
|
||||
@@ -120,7 +120,7 @@ WeakMapBase::sweepCompartment(JSCompartment *c)
|
||||
|
||||
#ifdef DEBUG
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next)
|
||||
JS_ASSERT(m->isInList() && m->marked);
|
||||
MOZ_ASSERT(m->isInList() && m->marked);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -149,8 +149,8 @@ WeakMapBase::restoreCompartmentMarkedWeakMaps(WeakMapSet &markedWeakMaps)
|
||||
{
|
||||
for (WeakMapSet::Range r = markedWeakMaps.all(); !r.empty(); r.popFront()) {
|
||||
WeakMapBase *map = r.front();
|
||||
JS_ASSERT(map->compartment->zone()->isGCMarking());
|
||||
JS_ASSERT(!map->marked);
|
||||
MOZ_ASSERT(map->compartment->zone()->isGCMarking());
|
||||
MOZ_ASSERT(!map->marked);
|
||||
map->marked = true;
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ IsWeakMap(HandleValue v)
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_has_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsWeakMap(args.thisv()));
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
if (args.length() < 1) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
|
||||
@@ -248,7 +248,7 @@ js::WeakMap_has(JSContext *cx, unsigned argc, Value *vp)
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_clear_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsWeakMap(args.thisv()));
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
// We can't js_delete the weakmap because the data gathered during GC is
|
||||
// used by the Cycle Collector.
|
||||
@@ -269,7 +269,7 @@ js::WeakMap_clear(JSContext *cx, unsigned argc, Value *vp)
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsWeakMap(args.thisv()));
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
if (args.length() < 1) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
|
||||
@@ -301,7 +301,7 @@ js::WeakMap_get(JSContext *cx, unsigned argc, Value *vp)
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_delete_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsWeakMap(args.thisv()));
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
if (args.length() < 1) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
|
||||
@@ -339,7 +339,7 @@ TryPreserveReflector(JSContext *cx, HandleObject obj)
|
||||
(obj->is<ProxyObject>() &&
|
||||
obj->as<ProxyObject>().handler()->family() == GetDOMProxyHandlerFamily()))
|
||||
{
|
||||
JS_ASSERT(cx->runtime()->preserveWrapperCallback);
|
||||
MOZ_ASSERT(cx->runtime()->preserveWrapperCallback);
|
||||
if (!cx->runtime()->preserveWrapperCallback(cx, obj)) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BAD_WEAKMAP_KEY);
|
||||
return false;
|
||||
@@ -399,7 +399,7 @@ SetWeakMapEntryInternal(JSContext *cx, Handle<WeakMapObject*> mapObj,
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_ASSERT(key->compartment() == mapObj->compartment());
|
||||
MOZ_ASSERT(key->compartment() == mapObj->compartment());
|
||||
JS_ASSERT_IF(value.isObject(), value.toObject().compartment() == mapObj->compartment());
|
||||
if (!map->put(key, value)) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
@@ -412,7 +412,7 @@ SetWeakMapEntryInternal(JSContext *cx, Handle<WeakMapObject*> mapObj,
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_set_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsWeakMap(args.thisv()));
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
if (args.length() < 1) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
|
||||
@@ -573,7 +573,7 @@ static const JSFunctionSpec weak_map_methods[] = {
|
||||
static JSObject *
|
||||
InitWeakMapClass(JSContext *cx, HandleObject obj, bool defineMembers)
|
||||
{
|
||||
JS_ASSERT(obj->isNative());
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user