mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 960246 - Handle failures when running message manager message handlers (r=smaug)
This commit is contained in:
parent
80d927b020
commit
07ed5d4c9c
@ -1044,14 +1044,19 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
JS_CallFunctionValue(cx, thisObject,
|
||||
funval, 1, argv.address(), rval.address());
|
||||
if (!JS_CallFunctionValue(cx, thisObject,
|
||||
funval, 1, argv.address(), rval.address())) {
|
||||
nsJSUtils::ReportPendingException(cx);
|
||||
continue;
|
||||
}
|
||||
if (aJSONRetVal) {
|
||||
nsString json;
|
||||
if (JS_Stringify(cx, &rval, JS::NullPtr(), JS::NullHandleValue,
|
||||
if (!JS_Stringify(cx, &rval, JS::NullPtr(), JS::NullHandleValue,
|
||||
JSONCreator, &json)) {
|
||||
aJSONRetVal->AppendElement(json);
|
||||
nsJSUtils::ReportPendingException(cx);
|
||||
continue;
|
||||
}
|
||||
aJSONRetVal->AppendElement(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user