Permalink
Browse files

ExceptionLab - stack processing

  • Loading branch information...
1 parent 8934e57 commit 6f74fe18d179c59338336468f0f6413f0f9aff07 @victor-homyakov victor-homyakov committed Feb 10, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/functional/ExceptionLab.html
@@ -9,12 +9,25 @@
width: 100%;
}
</style>
+ <script src="../../stacktrace.js"></script>
<script src="ExceptionLab.js"></script>
<script>
+ var lastException;
+
+ function dumpStacktrace(guess) {
+ var trace = printStackTrace({
+ e: lastException,
+ guess: guess
+ });
+ var text = trace.join("\n\n");
+ document.getElementById("info").innerHTML = text;
+ }
+
function dumpException(ex) {
ex = ex || new Error("Default error");
var text = "{\n " + getExceptionProps(ex).join(",\n ") + "\n}";
document.getElementById("info").innerHTML = text;
+ lastException = ex;
}
function dumpException1() {
@@ -69,5 +82,8 @@
<button onclick="dumpException3();">Exception 3</button>
<button onclick="dumpException4();">Exception 4</button>
<button onclick="dumpException5();">Exception 5</button>
+ <br/>
+ <button onclick="dumpStacktrace();">Process stack trace</button>
+ <button onclick="dumpStacktrace(true);">Guess anonymous functions</button>
</body>
</html>

0 comments on commit 6f74fe1

Please sign in to comment.