Add new debug option - rawExceptions - to prevent catching exceptions thrown by the VM, use for debugging the VM.

Sat, 22 May 2010 20:08:03 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 22 May 2010 20:08:03 +0100
changeset 25
9e62bc13b30d
parent 24
5c9d8a65c87d
child 26
5c7eafb47830

Add new debug option - rawExceptions - to prevent catching exceptions thrown by the VM, use for debugging the VM.

lvm.js file | annotate | diff | comparison | revisions
--- a/lvm.js	Sat May 22 20:07:05 2010 +0100
+++ b/lvm.js	Sat May 22 20:08:03 2010 +0100
@@ -11,6 +11,7 @@
 var OP_CLOSURE = 36;
 
 var debugMode = false;
+var rawExceptions = true;
 
 function LValue(type, value)
 {
@@ -371,10 +372,15 @@
 
 var f = new LFunction(c, default_environment);
 
-try{
+if(rawExceptions)
 	testvm.run(f);
+else
+{
+	try{
+		testvm.run(f);
+	}
+	catch(e)
+	{
+		print("Error: " + e);
+	}
 }
-catch(e)
-{
-	print("Error: " + e);
-}

mercurial