зеркало из https://github.com/mozilla/gecko-dev.git
Bug 857648 part 5. Expose a .stack property on DOMExceptions. r=khuey
This commit is contained in:
Родитель
a0954ac75c
Коммит
87884f3b8f
|
@ -63,7 +63,8 @@ function runTests()
|
|||
method: "display",
|
||||
code: error4,
|
||||
result: error4 + openComment + "Exception: Node cannot be inserted " +
|
||||
"at the specified point in the hierarchy\n@1" + closeComment,
|
||||
"at the specified point in the hierarchy\n@" +
|
||||
scratchpad.uniqueName + ":1:0" + closeComment,
|
||||
label: "Alternative format error display output"
|
||||
},
|
||||
{
|
||||
|
@ -100,7 +101,8 @@ function runTests()
|
|||
method: "run",
|
||||
code: error4,
|
||||
result: error4 + openComment + "Exception: Node cannot be inserted " +
|
||||
"at the specified point in the hierarchy\n@1" + closeComment,
|
||||
"at the specified point in the hierarchy\n@" +
|
||||
scratchpad.uniqueName + ":1:0" + closeComment,
|
||||
label: "Alternative format error run output"
|
||||
}];
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "xpcprivate.h"
|
||||
|
||||
#include "mozilla/dom/DOMExceptionBinding.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -553,6 +554,14 @@ Exception::GetData() const
|
|||
return data.forget();
|
||||
}
|
||||
|
||||
void
|
||||
Exception::GetStack(nsAString& aStack, ErrorResult& aRv) const
|
||||
{
|
||||
if (mLocation) {
|
||||
aRv = mLocation->GetFormattedStack(aStack);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Exception::Stringify(nsString& retval)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,8 @@ NS_GetNameAndMessageForDOMNSResult(nsresult aNSResult, nsACString& aName,
|
|||
uint16_t* aCode = nullptr);
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
|
||||
namespace dom {
|
||||
|
||||
#define MOZILLA_EXCEPTION_IID \
|
||||
|
@ -81,6 +83,8 @@ public:
|
|||
|
||||
already_AddRefed<nsISupports> GetData() const;
|
||||
|
||||
void GetStack(nsAString& aStack, ErrorResult& aRv) const;
|
||||
|
||||
void Stringify(nsString& retval);
|
||||
|
||||
// XPCOM factory ctor.
|
||||
|
|
|
@ -56,6 +56,10 @@ interface ExceptionMembers
|
|||
|
||||
// Arbitary data for the implementation.
|
||||
readonly attribute nsISupports? data;
|
||||
|
||||
// Formatted exception stack
|
||||
[Throws, Replaceable]
|
||||
readonly attribute DOMString stack;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
|
|
Загрузка…
Ссылка в новой задаче