From e501d7e0b56670a28b8e5e6666ea785be1436a95 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 5 Jul 2010 13:56:20 -0700 Subject: [PATCH] Remove lowercase/uppercase name check --- js/src/xpconnect/src/xpcwrappednative.cpp | 57 +---------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/js/src/xpconnect/src/xpcwrappednative.cpp b/js/src/xpconnect/src/xpcwrappednative.cpp index eb76e018073..656e766620a 100644 --- a/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/js/src/xpconnect/src/xpcwrappednative.cpp @@ -3351,62 +3351,7 @@ XPCWrappedNative::HandlePossibleNameCaseError(XPCCallContext& ccx, XPCNativeMember* member; XPCNativeInterface* localIface; - /* PRUnichar->char->PRUnichar hack is to avoid pulling in i18n code. */ - if(JSID_IS_STRING(name) && - nsnull != (oldJSStr = JSID_TO_STRING(name)) && - nsnull != (oldStr = (PRUnichar*) JS_GetStringChars(oldJSStr)) && - oldStr[0] != 0 && - oldStr[0] >> 8 == 0 && - nsCRT::IsUpper((char)oldStr[0]) && - nsnull != (newStr = nsCRT::strdup(oldStr))) - { - newStr[0] = (PRUnichar) nsCRT::ToLower((char)newStr[0]); - newJSStr = JS_InternUCString(ccx, (const jschar*)newStr); - nsCRT::free(newStr); - if (!newJSStr) - return; - - jsid id = INTERNED_STRING_TO_JSID(newJSStr); - if(set ? set->FindMember(id, &member, &localIface) - : NS_PTR_TO_INT32(iface->FindMember(id))) - { - // found it! - const char* ifaceName = set ? - localIface->GetNameString() : - iface->GetNameString(); - const char* goodName = JS_GetStringBytes(newJSStr); - const char* badName = JS_GetStringBytes(oldJSStr); - char* locationStr = nsnull; - - nsCOMPtr e; - nsXPCException::NewException("", NS_OK, nsnull, nsnull, getter_AddRefs(e)); - - if(e) - { - nsresult rv; - nsCOMPtr loc; - rv = e->GetLocation(getter_AddRefs(loc)); - if(NS_SUCCEEDED(rv) && loc) { - loc->ToString(&locationStr); // failure here leaves it nsnull. - } - } - - if(locationStr && ifaceName && goodName && badName ) - { - printf("**************************************************\n" - "ERROR: JS code at [%s]\n" - "tried to access nonexistent property called\n" - "\'%s\' on interface of type \'%s\'.\n" - "That interface does however have a property called\n" - "\'%s\'. Did you mean to access that lowercase property?\n" - "Please fix the JS code as appropriate.\n" - "**************************************************\n", - locationStr, badName, ifaceName, goodName); - } - if(locationStr) - nsMemory::Free(locationStr); - } - } + // TODO: remove this all more thoroughly. } #endif