Followup change for bug 307289. Adding comment per jband's suggestion, and a warning to catch callers that restore the current prototype.

This commit is contained in:
jst%mozilla.jstenback.com 2005-09-08 16:34:29 +00:00
Родитель cbb887f552
Коммит 07ba15436d
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1049,6 +1049,12 @@ nsXPConnect::RestoreWrappedNativePrototype(JSContext * aJSContext,
// entry for aClassInfo in the map we have to remove it to
// be able to add the new one.
map->Remove(aClassInfo);
// This code should do the right thing even if we're
// restoring the current proto, but warn in that case
// since doing that is pointless.
NS_WARN_IF_FALSE(proto != oldProto,
"Restoring current prototype, fix caller!");
}
map->Add(aClassInfo, proto);