зеркало из https://github.com/mozilla/gecko-dev.git
Bug 850000 - Don't clobber exceptions set in security wrapper check() hooks. r=mrbkap
This commit is contained in:
Родитель
8818d46337
Коммит
b846f66210
|
@ -357,7 +357,12 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
|||
allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)
|
||||
: true;
|
||||
recordEnter(cx, wrapper, id);
|
||||
if (!allow && !rv && mayThrow)
|
||||
// We want to throw an exception if all of the following are true:
|
||||
// * The policy disallowed access.
|
||||
// * The policy set rv to false, indicating that we should throw.
|
||||
// * The caller did not instruct us to ignore exceptions.
|
||||
// * The policy did not throw itself.
|
||||
if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))
|
||||
reportError(cx, id);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче