Remove rawExceptions flag, always print exception's stack trace if it has one

Sun, 23 May 2010 12:46:02 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 23 May 2010 12:46:02 +0100
changeset 29
62f3df8ed204
parent 28
d14b47c3870f
child 30
10fd886c4e8a

Remove rawExceptions flag, always print exception's stack trace if it has one

lvm.js file | annotate | diff | comparison | revisions
--- a/lvm.js	Sun May 23 02:38:45 2010 +0100
+++ b/lvm.js	Sun May 23 12:46:02 2010 +0100
@@ -14,7 +14,7 @@
 var OP_CLOSURE = 36;
 
 var debugMode = false;
-var rawExceptions = true;
+var rawExceptions = false;
 
 function LValue(type, value)
 {
@@ -417,15 +417,12 @@
 
 var f = new LFunction(c, default_environment);
 
-if(rawExceptions)
+try{
 	testvm.run(f);
-else
+}
+catch(e)
 {
-	try{
-		testvm.run(f);
-	}
-	catch(e)
-	{
-		print("Error: " + e);
-	}
+	print("Error: " + e);
+	if(stack in e)
+		print(e.stack);
 }

mercurial