Bug 1220728 Clear pending exceptions if string conversion fails in SW intercept error handling. r=bz

This commit is contained in:
Ben Kelly 2015-11-02 09:49:34 -08:00
Родитель 08b94a69ed
Коммит 9a99bbe66c
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -396,8 +396,8 @@ ExtractErrorValues(JSContext* aCx, JS::Handle<JS::Value> aValue,
else if(NS_SUCCEEDED(UNWRAP_OBJECT(DOMException, obj, domException))) {
nsAutoString filename;
if (NS_SUCCEEDED(domException->GetFilename(filename)) &&
!filename.IsEmpty()) {
domException->GetFilename(filename);
if (!filename.IsEmpty()) {
CopyUTF16toUTF8(filename, aSourceSpecOut);
*aLineOut = domException->LineNumber();
*aColumnOut = domException->ColumnNumber();
@ -419,6 +419,8 @@ ExtractErrorValues(JSContext* aCx, JS::Handle<JS::Value> aValue,
nsAutoJSString jsString;
if (jsString.init(aCx, aValue)) {
aMessageOut = jsString;
} else {
JS_ClearPendingException(aCx);
}
}
}