Pass vm as 'this' to native functions

Fri, 28 May 2010 02:20:58 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 28 May 2010 02:20:58 +0100
changeset 52
cae5ea4e3321
parent 51
b429e7a73de7
child 53
71208f97d9ca

Pass vm as 'this' to native functions

lvm.js file | annotate | diff | comparison | revisions
--- a/lvm.js	Fri May 28 02:20:35 2010 +0100
+++ b/lvm.js	Fri May 28 02:20:58 2010 +0100
@@ -380,7 +380,7 @@
 				if(typeof(f) == "function")
 				{
 					// JS native function
-					var ret = f.apply(null, args.map(function (a) { return a.value; }));
+					var ret = f.apply(this, args.map(function (a) { return a.value; }));
 				}
 				else
 				{

mercurial