Wed, 24 Nov 2010 02:47:47 +0000
Better verification of function validity in LVM.call()
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Mon Nov 22 19:38:27 2010 +0000 +++ b/lvm.js Wed Nov 24 02:47:47 2010 +0000 @@ -403,7 +403,7 @@ { return f.apply(this, args); } - else + else if(f.instructions) { var frame = {f:f,pc:0,entry:true}; if(args) @@ -415,6 +415,8 @@ frame.reg[i] = this.LValue(null); return this.run(frame); } + else + throw "Attempt to call invalid function object: "+f.toString(); }, run: function(frame) {