lvm.js

changeset 60
430a0b155703
parent 59
3ac959479e85
child 61
6acdef1dfb92
--- a/lvm.js	Fri Nov 19 03:38:18 2010 +0000
+++ b/lvm.js	Fri Nov 19 03:38:41 2010 +0000
@@ -60,10 +60,12 @@
 			else if(raw != true && this.metatable && this.metatable.type != "nil")
 			{
 				var __index = this.metatable.index(new LValue("string", "__index"));
-				if(__index.type != "nil")
+				if(__index.type == "function")
 				{
 					return LValueFromValue(__index.call([this, key])[0]);
 				}
+				else if(__index.type != "nil")
+					return __index.index(key);
 			}
 			return new LValue("nil", null);
 		}

mercurial