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

git-svn-id: svn://10.0.0.236/trunk@54044 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com
1999-11-20 07:13:25 +00:00
parent 7bb8856626
commit 8b7f58ab3c
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) {