diff tcb.js @ 8:e14f496e6e08

added a handleError() function to the TCB, which is called whenever an unhandled exception occurs. Also fixed a bug in the setting of lastException.
author Atul Varma <varmaa@toolness.com>
date Fri, 19 Jun 2009 12:22:52 -0700
parents 1b374020485b
children 16a605ff036c
line wrap: on
line diff
--- a/tcb.js	Fri Jun 19 09:34:09 2009 -0700
+++ b/tcb.js	Fri Jun 19 12:22:52 2009 -0700
@@ -1,3 +1,10 @@
+// This function is called by the platform whenever an uncaught exception
+// occurs.
+function handleError() {
+  printTraceback(lastExceptionTraceback);
+  print(lastException);
+}
+
 function printTraceback(frame) {
   print("Traceback (most recent call last):");
   if (frame === undefined)