зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1098074 - Part 1: Use AutoJSAPI to report JS errors in nsFrameMessageManager; r=bholley
--HG-- extra : rebase_source : c61375bb851385e6e859b85ee97293ebf12e77ce
This commit is contained in:
Родитель
ae5c2d16a1
Коммит
e211ebf6cc
|
@ -976,6 +976,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
|||
nsIGlobalObject* nativeGlobal =
|
||||
xpc::NativeGlobal(js::GetGlobalForObjectCrossCompartment(wrappedJS->GetJSObject()));
|
||||
AutoEntryScript aes(nativeGlobal);
|
||||
aes.TakeOwnershipOfErrorReporting();
|
||||
JSContext* cx = aes.cx();
|
||||
JS::Rooted<JSObject*> object(cx, wrappedJS->GetJSObject());
|
||||
|
||||
|
@ -1076,15 +1077,14 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (!JS_CallFunctionValue(cx, thisObject, funval, JS::HandleValueArray(argv), &rval)) {
|
||||
nsJSUtils::ReportPendingException(cx);
|
||||
if (!JS_CallFunctionValue(cx, thisObject, funval,
|
||||
JS::HandleValueArray(argv), &rval)) {
|
||||
continue;
|
||||
}
|
||||
if (aJSONRetVal) {
|
||||
nsString json;
|
||||
if (!JS_Stringify(cx, &rval, JS::NullPtr(), JS::NullHandleValue,
|
||||
JSONCreator, &json)) {
|
||||
nsJSUtils::ReportPendingException(cx);
|
||||
continue;
|
||||
}
|
||||
aJSONRetVal->AppendElement(json);
|
||||
|
|
Загрузка…
Ссылка в новой задаче