mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Backed out changeset c4faeb0be959 (bug 1257919)
This commit is contained in:
parent
336c2cc4ae
commit
e6e4d30446
@ -1053,7 +1053,7 @@ StackFrameToStackEntry(JSContext* aCx, nsIStackFrame* aStackFrame,
|
||||
|
||||
aStackEntry.mColumnNumber = columnNumber;
|
||||
|
||||
rv = aStackFrame->GetName(aCx, aStackEntry.mFunctionName);
|
||||
rv = aStackFrame->GetName(aStackEntry.mFunctionName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsString cause;
|
||||
|
@ -369,16 +369,17 @@ NS_IMETHODIMP JSStackFrame::GetFilename(JSContext* aCx, nsAString& aFilename)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP JSStackFrame::GetName(JSContext* aCx, nsAString& aFunction)
|
||||
NS_IMETHODIMP JSStackFrame::GetName(nsAString& aFunction)
|
||||
{
|
||||
if (!mStack) {
|
||||
aFunction.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
JS::Rooted<JSString*> name(aCx);
|
||||
ThreadsafeAutoJSContext cx;
|
||||
JS::Rooted<JSString*> name(cx);
|
||||
bool canCache = false, useCachedValue = false;
|
||||
GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameFunctionDisplayName,
|
||||
GetValueIfNotCached(cx, mStack, JS::GetSavedFrameFunctionDisplayName,
|
||||
mFunnameInitialized, &canCache, &useCachedValue,
|
||||
&name);
|
||||
|
||||
@ -389,8 +390,8 @@ NS_IMETHODIMP JSStackFrame::GetName(JSContext* aCx, nsAString& aFunction)
|
||||
|
||||
if (name) {
|
||||
nsAutoJSString str;
|
||||
if (!str.init(aCx, name)) {
|
||||
JS_ClearPendingException(aCx);
|
||||
if (!str.init(cx, name)) {
|
||||
JS_ClearPendingException(cx);
|
||||
aFunction.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
@ -643,7 +644,7 @@ NS_IMETHODIMP JSStackFrame::ToString(JSContext* aCx, nsACString& _retval)
|
||||
}
|
||||
|
||||
nsString funname;
|
||||
rv = GetName(aCx, funname);
|
||||
rv = GetName(funname);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (funname.IsEmpty()) {
|
||||
|
@ -59,7 +59,7 @@ SandboxLogJSStack(void)
|
||||
lineNumber = 0;
|
||||
Unused << frame->GetLineNumber(&lineNumber);
|
||||
funName.SetIsVoid(true);
|
||||
Unused << frame->GetName(cx, funName);
|
||||
Unused << frame->GetName(funName);
|
||||
|
||||
if (!funName.IsVoid() || !fileName.IsVoid()) {
|
||||
SANDBOX_LOG_ERROR("JS frame %d: %s %s line %d", i,
|
||||
|
@ -18,7 +18,6 @@ interface nsIStackFrame : nsISupports
|
||||
readonly attribute AUTF8String languageName;
|
||||
[implicit_jscontext]
|
||||
readonly attribute AString filename;
|
||||
[implicit_jscontext]
|
||||
readonly attribute AString name;
|
||||
// Valid line numbers begin at '1'. '0' indicates unknown.
|
||||
readonly attribute int32_t lineNumber;
|
||||
|
Loading…
Reference in New Issue
Block a user