mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 12734. Make check for duplicate insertions debug-only. Thanks to zee@northrock.bm
This commit is contained in:
parent
ce26e31713
commit
f4acc98b16
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user