Fixing bug 380474. Use the inner object when looking up methods and adding event listeners. r=mrbkap@mozilla.org, sr=brendan@mozilla.org

This commit is contained in:
jst@mozilla.org 2007-06-27 17:28:02 -07:00
parent b30f4be28c
commit a859c10ced
2 changed files with 4 additions and 0 deletions

View File

@ -6620,6 +6620,8 @@ nsEventReceiverSH::AddEventListenerHelper(JSContext *cx, JSObject *obj,
return JS_FALSE;
}
OBJ_TO_INNER_OBJECT(cx, obj);
nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
nsresult rv =
sXPConnect->GetWrappedNativeOfJSObject(cx, obj, getter_AddRefs(wrapper));

View File

@ -2786,6 +2786,8 @@ nsXPCComponents_Utils::LookupMethod()
JSObject* obj = JSVAL_TO_OBJECT(argv[0]);
OBJ_TO_INNER_OBJECT(cx, obj);
// second param must be a string
if(!JSVAL_IS_STRING(argv[1]))
return NS_ERROR_XPC_BAD_CONVERT_JS;