Bug 696668 - Give nsIScriptContext::CallEventHandler a JSObject scope parameter; r=mrbkap

This commit is contained in:
Ms2ger 2011-10-29 22:19:03 +02:00
parent 94dc2deff1
commit 59007b3a67
3 changed files with 7 additions and 8 deletions

View File

@ -74,8 +74,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContextPrincipal,
NS_ISCRIPTCONTEXTPRINCIPAL_IID)
#define NS_ISCRIPTCONTEXT_IID \
{ 0x530d739f, 0x6d79, 0x4919, \
{ 0x82, 0xb0, 0xef, 0xeb, 0x75, 0xf8, 0xa6, 0x3f } }
{ 0x2e583bf4, 0x3c1f, 0x432d, \
{ 0x82, 0x83, 0x8d, 0xee, 0x7e, 0xcc, 0xc8, 0x8b } }
/* This MUST match JSVERSION_DEFAULT. This version stuff if we don't
know what language we have is a little silly... */
@ -226,7 +226,7 @@ public:
* @param rval out parameter returning result
**/
virtual nsresult CallEventHandler(nsISupports* aTarget,
void *aScope, void* aHandler,
JSObject* aScope, void* aHandler,
nsIArray *argv, nsIVariant **rval) = 0;
/**

View File

@ -1852,8 +1852,8 @@ nsJSContext::CompileFunction(void* aTarget,
}
nsresult
nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler,
nsIArray *aargv, nsIVariant **arv)
nsJSContext::CallEventHandler(nsISupports* aTarget, JSObject* aScope,
void *aHandler, nsIArray *aargv, nsIVariant **arv)
{
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
@ -1875,8 +1875,7 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
JSAutoRequest ar(mContext);
JSObject* target = nsnull;
nsresult rv = JSObjectFromInterface(aTarget, static_cast<JSObject*>(aScope),
&target);
nsresult rv = JSObjectFromInterface(aTarget, aScope, &target);
NS_ENSURE_SUCCESS(rv, rv);
js::AutoObjectRooter targetVal(mContext, target);

View File

@ -109,7 +109,7 @@ public:
const char *aURL, PRUint32 aLineNo,
PRUint32 aVersion,
nsScriptObjectHolder &aHandler);
virtual nsresult CallEventHandler(nsISupports* aTarget, void *aScope,
virtual nsresult CallEventHandler(nsISupports* aTarget, JSObject* aScope,
void* aHandler,
nsIArray *argv, nsIVariant **rv);
virtual nsresult BindCompiledEventHandler(nsISupports *aTarget,