Backed out changeset e4dd7f8cf275 (bug 857648)

This commit is contained in:
Carsten "Tomcat" Book 2014-07-04 08:23:32 +02:00
parent e8584376bc
commit 0715e0d433
2 changed files with 1 additions and 39 deletions

View File

@ -277,7 +277,6 @@ public:
NS_IMETHOD GetFilename(nsAString& aFilename) MOZ_OVERRIDE;
NS_IMETHOD GetName(nsAString& aFunction) MOZ_OVERRIDE;
NS_IMETHOD GetCaller(nsIStackFrame** aCaller) MOZ_OVERRIDE;
NS_IMETHOD GetFormattedStack(nsAString& aStack) MOZ_OVERRIDE;
protected:
virtual bool IsJSFrame() const MOZ_OVERRIDE {
@ -290,13 +289,11 @@ private:
virtual ~JSStackFrame();
JS::Heap<JSObject*> mStack;
nsString mFormattedStack;
bool mFilenameInitialized;
bool mFunnameInitialized;
bool mLinenoInitialized;
bool mCallerInitialized;
bool mFormattedStackInitialized;
};
JSStackFrame::JSStackFrame(JS::Handle<JSObject*> aStack)
@ -305,7 +302,6 @@ JSStackFrame::JSStackFrame(JS::Handle<JSObject*> aStack)
, mFunnameInitialized(false)
, mLinenoInitialized(false)
, mCallerInitialized(false)
, mFormattedStackInitialized(false)
{
MOZ_ASSERT(mStack);
@ -499,35 +495,6 @@ NS_IMETHODIMP StackFrame::GetCaller(nsIStackFrame** aCaller)
return NS_OK;
}
NS_IMETHODIMP JSStackFrame::GetFormattedStack(nsAString& aStack)
{
if (!mFormattedStackInitialized) {
ThreadsafeAutoJSContext cx;
JS::Rooted<JS::Value> stack(cx, JS::ObjectValue(*mStack));
JS::ExposeObjectToActiveJS(mStack);
JSAutoCompartment ac(cx, mStack);
JS::Rooted<JSString*> formattedStack(cx, JS::ToString(cx, stack));
if (!formattedStack) {
return NS_ERROR_UNEXPECTED;
}
nsDependentJSString str;
if (!str.init(cx, formattedStack)) {
return NS_ERROR_OUT_OF_MEMORY;
}
mFormattedStack = str;
mFormattedStackInitialized = true;
}
aStack = mFormattedStack;
return NS_OK;
}
NS_IMETHODIMP StackFrame::GetFormattedStack(nsAString& aStack)
{
aStack.Truncate();
return NS_OK;
}
/* AUTF8String toString (); */
NS_IMETHODIMP StackFrame::ToString(nsACString& _retval)
{

View File

@ -10,7 +10,7 @@
#include "nsISupports.idl"
[scriptable, uuid(13b75be1-f950-497b-81e4-a0214a14e5ae)]
[scriptable, uuid(3bc4793f-e6be-44d6-b839-d6b9e85e5346)]
interface nsIStackFrame : nsISupports
{
// see nsIProgrammingLanguage for list of language consts
@ -23,11 +23,6 @@ interface nsIStackFrame : nsISupports
readonly attribute AUTF8String sourceLine;
readonly attribute nsIStackFrame caller;
// Returns a formatted stack string that looks like the sort of
// string that would be returned by .stack on JS Error objects.
// Only works on JS-language stack frames.
readonly attribute AString formattedStack;
AUTF8String toString();
};