From 8c9b4771384e464c177a7eb82ca9a05aefc65580 Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Tue, 29 Jun 1999 21:37:09 +0000 Subject: [PATCH] Fixing lame bug in two Find implementations - thanks shaver. Removing commented out dead code --- js/src/xpconnect/src/xpcwrappedjs.cpp | 2 +- js/src/xpconnect/src/xpcwrappedjsclass.cpp | 24 ---------------------- js/src/xpconnect/src/xpcwrappednative.cpp | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/js/src/xpconnect/src/xpcwrappedjs.cpp b/js/src/xpconnect/src/xpcwrappedjs.cpp index 57dc3f47fcb..bafca046cef 100644 --- a/js/src/xpconnect/src/xpcwrappedjs.cpp +++ b/js/src/xpconnect/src/xpcwrappedjs.cpp @@ -240,7 +240,7 @@ nsXPCWrappedJS::Find(REFNSIID aIID) nsXPCWrappedJS* cur = mRoot; do { - if(aIID.Equals(GetIID())) + if(aIID.Equals(cur->GetIID())) return cur; } while(NULL != (cur = cur->mNext)); diff --git a/js/src/xpconnect/src/xpcwrappedjsclass.cpp b/js/src/xpconnect/src/xpcwrappedjsclass.cpp index a9976ccc66e..255ec67e403 100644 --- a/js/src/xpconnect/src/xpcwrappedjsclass.cpp +++ b/js/src/xpconnect/src/xpcwrappedjsclass.cpp @@ -124,29 +124,6 @@ nsXPCWrappedJSClass::~nsXPCWrappedJSClass() NS_RELEASE(mInfo); } -/***************************************************************************/ -// XXX for now IIDs are represented in JS as string objects containing strings -// of the form: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (just like the nsID -// Parse and ToString methods use. - -// XXX lots of room for optimization here! - -// JSObject* -// nsXPCWrappedJSClass::CreateIIDJSObject(REFNSIID aIID) -// { -// JSObject* obj = NULL; -// char* str = aIID.ToString(); -// if(str) -// { -// JSContext* cx = GetJSContext(); -// JSString* jsstr = JS_InternString(cx, str); -// delete [] str; -// if(jsstr) -// JS_ValueToObject(cx, STRING_TO_JSVAL(jsstr), &obj); -// } -// return obj; -// } - JSObject* nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSObject* jsobj, REFNSIID aIID) { @@ -159,7 +136,6 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSObject* jsobj, REFNSIID aIID if(!cx) return NULL; -// id = CreateIIDJSObject(aIID); id = xpc_NewIIDObject(cx, aIID); if(id) diff --git a/js/src/xpconnect/src/xpcwrappednative.cpp b/js/src/xpconnect/src/xpcwrappednative.cpp index 1a6d7242c0c..bc8159b75b6 100644 --- a/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/js/src/xpconnect/src/xpcwrappednative.cpp @@ -313,7 +313,7 @@ nsXPCWrappedNative::Find(REFNSIID aIID) nsXPCWrappedNative* cur = mRoot; do { - if(aIID.Equals(GetIID())) + if(aIID.Equals(cur->GetIID())) return cur; } while(NULL != (cur = cur->mNext));