Bug 12734. Make check for duplicate insertions debug-only. Thanks to zee@northrock.bm

This commit is contained in:
waterson%netscape.com 1999-11-20 07:13:25 +00:00
parent ce26e31713
commit f4acc98b16
2 changed files with 2 additions and 8 deletions

View File

@ -1728,10 +1728,7 @@ nsXULElement::InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify)
// Make sure that we're not trying to insert the same child
// twice. If we do, the DOM APIs (e.g., GetNextSibling()), will
// freak out.
PRInt32 i = mChildren->IndexOf(aKid);
NS_ASSERTION(i < 0, "element is already a child");
if (i >= 0)
return NS_ERROR_FAILURE;
NS_ASSERTION(mChildren->IndexOf(aKid) < 0, "element is already a child");
PRBool insertOk = mChildren->InsertElementAt(aKid, aIndex);/* XXX fix up void array api to use nsresult's*/
if (insertOk) {

View File

@ -1728,10 +1728,7 @@ nsXULElement::InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify)
// Make sure that we're not trying to insert the same child
// twice. If we do, the DOM APIs (e.g., GetNextSibling()), will
// freak out.
PRInt32 i = mChildren->IndexOf(aKid);
NS_ASSERTION(i < 0, "element is already a child");
if (i >= 0)
return NS_ERROR_FAILURE;
NS_ASSERTION(mChildren->IndexOf(aKid) < 0, "element is already a child");
PRBool insertOk = mChildren->InsertElementAt(aKid, aIndex);/* XXX fix up void array api to use nsresult's*/
if (insertOk) {