Fri, 19 Nov 2010 19:41:57 +0000
Add LValue.truth() to return whether a value is (not(false) and not(nil))
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Fri Nov 19 19:28:48 2010 +0000 +++ b/lvm.js Fri Nov 19 19:41:57 2010 +0000 @@ -99,6 +99,12 @@ return this.value.toString(); } }, + truth: function () + { + if(this.type == "nil" || (this.type == "boolean" && this.value == false)) + return false; + return true; + }, add: function (op2) { var metamethod;