From 7822acf7d32f985a76fe7a1a95cd0bccd650ca51 Mon Sep 17 00:00:00 2001 From: "peterv%netscape.com" Date: Fri, 17 Jan 2003 15:16:33 +0000 Subject: [PATCH] Fix for bug 188500 (Some DOM classes do not resolve). r=sicking, sr=jst. git-svn-id: svn://10.0.0.236/trunk@136532 18797224-902f-48f8-a5cc-f745e15eee43 --- .../dom/src/base/nsScriptNameSpaceManager.cpp | 39 ++++--------------- .../src/build/nsScriptNameSpaceManager.cpp | 39 ++++--------------- 2 files changed, 16 insertions(+), 62 deletions(-) diff --git a/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp b/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp index 8ba5204d7cc..86f5e416206 100644 --- a/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp +++ b/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp @@ -432,42 +432,19 @@ nsScriptNameSpaceManager::RegisterInterface(nsIInterfaceInfo* aIfInfo, // interface name than to get the count of constants. The former is // always cached. The latter might require loading an xpt file! - PRUint16 constant_count = 0; *aFoundOld = PR_FALSE; - nsresult rv = aIfInfo->GetConstantCount(&constant_count); - if (NS_FAILED(rv)) { - NS_ERROR("can't get constant count"); - return rv; + nsGlobalNameStruct *s = AddToHash(NS_ConvertASCIItoUCS2(aIfName)); + NS_ENSURE_TRUE(s, NS_ERROR_OUT_OF_MEMORY); + + if (s->mType != nsGlobalNameStruct::eTypeNotInitialized) { + *aFoundOld = PR_TRUE; + + return NS_OK; } - if (constant_count) { - PRUint16 parent_constant_count = 0; + s->mType = nsGlobalNameStruct::eTypeInterface; - nsCOMPtr parent_info; - - aIfInfo->GetParent(getter_AddRefs(parent_info)); - - if (parent_info) { - rv = parent_info->GetConstantCount(&parent_constant_count); - if (NS_FAILED(rv)) { - NS_ERROR("can't get constant count"); - return rv; - } - } - - if (constant_count != parent_constant_count) { - nsGlobalNameStruct *s = AddToHash(NS_ConvertASCIItoUCS2(aIfName)); - NS_ENSURE_TRUE(s, NS_ERROR_OUT_OF_MEMORY); - - if (s->mType != nsGlobalNameStruct::eTypeNotInitialized) { - *aFoundOld = PR_TRUE; - return NS_OK; - } - - s->mType = nsGlobalNameStruct::eTypeInterface; - } - } return NS_OK; } diff --git a/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp b/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp index 8ba5204d7cc..86f5e416206 100644 --- a/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp +++ b/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp @@ -432,42 +432,19 @@ nsScriptNameSpaceManager::RegisterInterface(nsIInterfaceInfo* aIfInfo, // interface name than to get the count of constants. The former is // always cached. The latter might require loading an xpt file! - PRUint16 constant_count = 0; *aFoundOld = PR_FALSE; - nsresult rv = aIfInfo->GetConstantCount(&constant_count); - if (NS_FAILED(rv)) { - NS_ERROR("can't get constant count"); - return rv; + nsGlobalNameStruct *s = AddToHash(NS_ConvertASCIItoUCS2(aIfName)); + NS_ENSURE_TRUE(s, NS_ERROR_OUT_OF_MEMORY); + + if (s->mType != nsGlobalNameStruct::eTypeNotInitialized) { + *aFoundOld = PR_TRUE; + + return NS_OK; } - if (constant_count) { - PRUint16 parent_constant_count = 0; + s->mType = nsGlobalNameStruct::eTypeInterface; - nsCOMPtr parent_info; - - aIfInfo->GetParent(getter_AddRefs(parent_info)); - - if (parent_info) { - rv = parent_info->GetConstantCount(&parent_constant_count); - if (NS_FAILED(rv)) { - NS_ERROR("can't get constant count"); - return rv; - } - } - - if (constant_count != parent_constant_count) { - nsGlobalNameStruct *s = AddToHash(NS_ConvertASCIItoUCS2(aIfName)); - NS_ENSURE_TRUE(s, NS_ERROR_OUT_OF_MEMORY); - - if (s->mType != nsGlobalNameStruct::eTypeNotInitialized) { - *aFoundOld = PR_TRUE; - return NS_OK; - } - - s->mType = nsGlobalNameStruct::eTypeInterface; - } - } return NS_OK; }