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

git-svn-id: svn://10.0.0.236/trunk@179847 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.jstenback.com 2005-09-08 16:34:29 +00:00
parent 25ca9adedf
commit e0c14e433d

View File

@ -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);