Bug 1257919 part 3. Make the various toString methods on exceptions take an explicit JSContext. r=khuey

This commit is contained in:
Boris Zbarsky
2016-03-22 13:50:31 -04:00
parent c1ee587239
commit 5e1fa9e66c
6 changed files with 13 additions and 10 deletions

View File

@@ -400,7 +400,7 @@ Exception::GetData(nsISupports** aData)
}
NS_IMETHODIMP
Exception::ToString(nsACString& _retval)
Exception::ToString(JSContext* aCx, nsACString& _retval)
{
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
@@ -413,7 +413,7 @@ Exception::ToString(nsACString& _retval)
if (mLocation) {
// we need to free this if it does not fail
nsresult rv = mLocation->ToString(location);
nsresult rv = mLocation->ToString(aCx, location);
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -547,13 +547,13 @@ Exception::GetStack(nsAString& aStack, ErrorResult& aRv) const
}
void
Exception::Stringify(nsString& retval)
Exception::Stringify(JSContext* aCx, nsString& retval)
{
nsCString str;
#ifdef DEBUG
DebugOnly<nsresult> rv =
#endif
ToString(str);
ToString(aCx, str);
MOZ_ASSERT(NS_SUCCEEDED(rv));
CopyUTF8toUTF16(str, retval);
}
@@ -592,7 +592,7 @@ DOMException::GetCode(uint16_t* aCode)
}
NS_IMETHODIMP
DOMException::ToString(nsACString& aReturn)
DOMException::ToString(JSContext* aCx, nsACString& aReturn)
{
aReturn.Truncate();