Add errors for when trying to index non-tables

Tue, 06 Apr 2010 14:46:30 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 06 Apr 2010 14:46:30 +0100
changeset 7
00ec5f6e7579
parent 6
418fd175eaed
child 8
e7de6d1fee96

Add errors for when trying to index non-tables

lvm.js file | annotate | diff | comparison | revisions
--- a/lvm.js	Mon Apr 05 17:23:18 2010 +0100
+++ b/lvm.js	Tue Apr 06 14:46:30 2010 +0100
@@ -30,6 +30,8 @@
 				return new LValue("nil", null);
 			return val;
 		}
+		else
+			throw "Attempt to index a " + this.type + " value";
 	},
 	setIndex: function (key, value)
 	{
@@ -37,6 +39,8 @@
 		{
 			this.value[key.value] = value;
 		}
+		else
+			throw "Attempt to index a " + this.type + " value";
 	}
 };
 

mercurial