зеркало из https://github.com/mozilla/pjs.git
Make sure to call ScriptEvaluated after running XBL constructors/destructors.
Bug 295124, r+sr=jst, a=asa.
This commit is contained in:
Родитель
2e62efb9e0
Коммит
5f1306128f
|
@ -315,14 +315,8 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
|||
|
||||
// Now call the method
|
||||
|
||||
nsCOMPtr<nsIJSContextStack> cxstack =
|
||||
do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = cxstack->Push(cx);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// Use nsCxPusher to make sure we call ScriptEvaluated when we're done.
|
||||
nsCxPusher pusher(aBoundElement);
|
||||
|
||||
// Check whether it's OK to call the method.
|
||||
rv = nsContentUtils::GetSecurityManager()->CheckFunctionAccess(cx, method, thisObject);
|
||||
|
@ -333,7 +327,6 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
|||
ok = ::JS_CallFunctionValue(cx, thisObject, OBJECT_TO_JSVAL(method),
|
||||
0 /* argc */, nsnull /* argv */, &retval);
|
||||
}
|
||||
cxstack->Pop(&cx);
|
||||
|
||||
if (!ok) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче