diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp index 175704c6549a..5b98b6a8f7bb 100644 --- a/dom/xul/nsXULElement.cpp +++ b/dom/xul/nsXULElement.cpp @@ -2332,24 +2332,18 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream, switch (childType) { case eType_Element: child = new nsXULPrototypeElement(); - child->mType = childType; - rv = child->Deserialize(aStream, aProtoDoc, aDocumentURI, aNodeInfos); if (NS_WARN_IF(NS_FAILED(rv))) return rv; break; case eType_Text: child = new nsXULPrototypeText(); - child->mType = childType; - rv = child->Deserialize(aStream, aProtoDoc, aDocumentURI, aNodeInfos); if (NS_WARN_IF(NS_FAILED(rv))) return rv; break; case eType_PI: child = new nsXULPrototypePI(); - child->mType = childType; - rv = child->Deserialize(aStream, aProtoDoc, aDocumentURI, aNodeInfos); if (NS_WARN_IF(NS_FAILED(rv))) return rv; @@ -2358,7 +2352,6 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream, // language version/options obtained during deserialization. nsXULPrototypeScript* script = new nsXULPrototypeScript(0, 0); child = script; - child->mType = childType; rv = aStream->ReadBoolean(&script->mOutOfLine); if (NS_WARN_IF(NS_FAILED(rv))) return rv; @@ -2384,6 +2377,7 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream, } MOZ_ASSERT(child, "Don't append null to mChildren"); + MOZ_ASSERT(child->mType == childType); mChildren.AppendElement(child); // Oh dear. Something failed during the deserialization.