mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Make XBL constructors/destructors check whether JS is enabled before running
once again. Bug 276205, r+sr=jst
This commit is contained in:
parent
a692c65a75
commit
17c1cc47cf
@ -48,6 +48,7 @@
|
||||
#include "nsXBLProtoImplMethod.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsXBLProtoImplMethod)
|
||||
|
||||
@ -288,9 +289,15 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
jsval retval;
|
||||
JSBool ok = ::JS_CallFunctionValue(cx, thisObject, OBJECT_TO_JSVAL(method),
|
||||
0 /* argc */, nsnull /* argv */, &retval);
|
||||
// Check whether it's OK to call the method.
|
||||
rv = nsContentUtils::GetSecurityManager()->CheckFunctionAccess(cx, method, thisObject);
|
||||
|
||||
JSBool ok = JS_TRUE;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
jsval retval;
|
||||
ok = ::JS_CallFunctionValue(cx, thisObject, OBJECT_TO_JSVAL(method),
|
||||
0 /* argc */, nsnull /* argv */, &retval);
|
||||
}
|
||||
cxstack->Pop(&cx);
|
||||
|
||||
if (!ok) {
|
||||
|
Loading…
Reference in New Issue
Block a user