зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1435483
part 12. Add an infallible "toString" method on nsIStackFrame. r=qdot
MozReview-Commit-ID: CTCawPvw6VZ
This commit is contained in:
Родитель
539cfc28e6
Коммит
fc5ae1f4a1
|
@ -330,8 +330,7 @@ Exception::ToString(JSContext* aCx, nsACString& _retval)
|
|||
|
||||
if (mLocation) {
|
||||
// we need to free this if it does not fail
|
||||
nsresult rv = mLocation->ToString(aCx, location);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mLocation->ToString(aCx, location);
|
||||
}
|
||||
|
||||
if (location.IsEmpty()) {
|
||||
|
|
|
@ -677,7 +677,15 @@ NS_IMETHODIMP JSStackFrame::GetNativeSavedFrame(JS::MutableHandle<JS::Value> aSa
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP JSStackFrame::ToString(JSContext* aCx, nsACString& _retval)
|
||||
NS_IMETHODIMP
|
||||
JSStackFrame::ToStringXPCOM(JSContext* aCx, nsACString& _retval)
|
||||
{
|
||||
ToString(aCx, _retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
JSStackFrame::ToString(JSContext* aCx, nsACString& _retval)
|
||||
{
|
||||
_retval.Truncate();
|
||||
|
||||
|
@ -702,7 +710,6 @@ NS_IMETHODIMP JSStackFrame::ToString(JSContext* aCx, nsACString& _retval)
|
|||
NS_ConvertUTF16toUTF8(filename).get(),
|
||||
NS_ConvertUTF16toUTF8(funname).get(),
|
||||
lineno);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIStackFrame>
|
||||
|
|
|
@ -41,7 +41,7 @@ interface nsIStackFrame : nsISupports
|
|||
// or null if this is not a native JavaScript stack frame.
|
||||
readonly attribute jsval nativeSavedFrame;
|
||||
|
||||
[implicit_jscontext]
|
||||
[implicit_jscontext, binaryname(ToStringXPCOM)]
|
||||
AUTF8String toString();
|
||||
|
||||
// Infallible things to be called from C++.
|
||||
|
@ -61,6 +61,8 @@ interface nsIStackFrame : nsISupports
|
|||
StackFrameRef getCaller(in JSContext aCx);
|
||||
[notxpcom, nostdcall]
|
||||
void getFormattedStack(in JSContext aCx, out AString aFormattedStack);
|
||||
[notxpcom, nostdcall, binaryname(ToString)]
|
||||
void toStringInfallible(in JSContext aCx, out AUTF8String aString);
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(4371b5bf-6845-487f-8d9d-3f1e4a9badd2)]
|
||||
|
|
Загрузка…
Ссылка в новой задаче